Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultConverter = newDefaultConverter()
DefaultConverter used when no implementation is provided for Converter interface.
var DefaultDownloader = &defaultDownloader{}
DefaultDownloader used when no implementation is provided for Downloader interface.
var DefaultParser = &defaultParser{}
DefaultParser used when no implementation is provided for Parser interface.
DefaultSlideshareDownloader used if the default implementation of downloader, parser and converter is sufficient.
Functions ¶
This section is empty.
Types ¶
type Converter ¶
type Converter interface { Reset() AddImage(r io.Reader, name string) error Save(w io.Writer) error }
Converter is the interface that wraps image conversion methods.
Reset resets the internal state of the parser. It may be empty based on the implementation.
AddImage append new image to the pdf. It returns any error encountered that caused save to fail.
Save writes pdf content to an io.Writer. It returns any error encountered that caused save to fail.
type Downloader ¶
Downloader is the interface that wraps the basic Download method.
Download downloads html of slideshare page and writes it to a given writer. It returns any error encountered that caused download or write to fail.
type PDFDownloader ¶
type PDFDownloader struct {
// contains filtered or unexported fields
}
PDFDownloader manages the process of pdf creation. It uses downloader to download slideshare pages html and slide images parser to extract images urls from slideshare pages and converter to convert images into a pdf.
func NewSlideshareDownloader ¶
func NewSlideshareDownloader(downloader Downloader, parser Parser, converter Converter) *PDFDownloader
NewSlideshareDownloader returns a new instance of PDFDownloader created from the given downloader, parser and converter.