Documentation
¶
Overview ¶
Package printer helps converting a specific file type to PDF.
Index ¶
- type ChromePrinterOptions
- type MergePrinterOptions
- type OfficePrinterOptions
- type Printer
- func NewHTMLPrinter(logger xlog.Logger, fpath string, opts ChromePrinterOptions) Printer
- func NewMarkdownPrinter(logger xlog.Logger, fpath string, opts ChromePrinterOptions) (Printer, error)
- func NewMergePrinter(logger xlog.Logger, fpaths []string, opts MergePrinterOptions) Printer
- func NewOfficePrinter(logger xlog.Logger, fpaths []string, opts OfficePrinterOptions) Printer
- func NewURLPrinter(logger xlog.Logger, url string, opts ChromePrinterOptions) Printer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChromePrinterOptions ¶
type ChromePrinterOptions struct {
WaitTimeout float64
WaitDelay float64
HeaderHTML string
PaperWidth float64
PaperHeight float64
MarginTop float64
MarginBottom float64
MarginLeft float64
MarginRight float64
Landscape bool
PageRanges string
RpccBufferSize int64
CustomHTTPHeaders map[string]string
Scale float64
}
ChromePrinterOptions helps customizing the Google Chrome Printer behaviour.
func DefaultChromePrinterOptions ¶
func DefaultChromePrinterOptions(config conf.Config) ChromePrinterOptions
DefaultChromePrinterOptions returns the default Google Chrome Printer options.
type MergePrinterOptions ¶
type MergePrinterOptions struct {
WaitTimeout float64
}
MergePrinterOptions helps customizing the merge Printer behaviour.
func DefaultMergePrinterOptions ¶
func DefaultMergePrinterOptions(config conf.Config) MergePrinterOptions
DefaultMergePrinterOptions returns the default merge Printer options.
type OfficePrinterOptions ¶
OfficePrinterOptions helps customizing the Office Printer behaviour.
func DefaultOfficePrinterOptions ¶
func DefaultOfficePrinterOptions(config conf.Config) OfficePrinterOptions
DefaultOfficePrinterOptions returns the default Office Printer options.
type Printer ¶
Printer is a type that can create a PDF file from a source. The source is defined in the underlying implementation.
func NewHTMLPrinter ¶
func NewHTMLPrinter(logger xlog.Logger, fpath string, opts ChromePrinterOptions) Printer
NewHTMLPrinter returns a Printer which is able to convert an HTML file to PDF.
func NewMarkdownPrinter ¶
func NewMarkdownPrinter(logger xlog.Logger, fpath string, opts ChromePrinterOptions) (Printer, error)
NewMarkdownPrinter returns a Printer which is able to convert Markdown files to PDF.
func NewMergePrinter ¶
func NewMergePrinter(logger xlog.Logger, fpaths []string, opts MergePrinterOptions) Printer
NewMergePrinter returns a Printer which is able to merge PDFs.
func NewOfficePrinter ¶
func NewOfficePrinter(logger xlog.Logger, fpaths []string, opts OfficePrinterOptions) Printer
NewOfficePrinter returns a Printer which is able to convert Office documents to PDF.
func NewURLPrinter ¶
func NewURLPrinter(logger xlog.Logger, url string, opts ChromePrinterOptions) Printer
NewURLPrinter returns a Printer which is able to convert a URL to PDF.