Documentation
¶
Overview ¶
Package pdfrender contains HTML to PDF implementations
Index ¶
- type Config
- type DefaultPDFRenderConfig
- func (config *DefaultPDFRenderConfig) GetDisplayHeaderFooter() *bool
- func (config *DefaultPDFRenderConfig) GetFooterTemplate() *string
- func (config *DefaultPDFRenderConfig) GetHeaderTemplate() *string
- func (config *DefaultPDFRenderConfig) GetLandscape() *bool
- func (config *DefaultPDFRenderConfig) GetMarginBottom() *float64
- func (config *DefaultPDFRenderConfig) GetMarginLeft() *float64
- func (config *DefaultPDFRenderConfig) GetMarginRight() *float64
- func (config *DefaultPDFRenderConfig) GetMarginTop() *float64
- func (config *DefaultPDFRenderConfig) GetPaperHeight() *float64
- func (config *DefaultPDFRenderConfig) GetPaperWidth() *float64
- func (config *DefaultPDFRenderConfig) GetPreferCSSPageSize() *bool
- func (config *DefaultPDFRenderConfig) GetPrintBackground() *bool
- func (config *DefaultPDFRenderConfig) GetScale() *float64
- type Document
- type PDFRenderer
- type RenderInfo
- type RenderPoolInfo
- type RenderPoolStats
- type TemplateName
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config interface { GetLandscape() *bool GetPrintBackground() *bool GetScale() *float64 GetPaperWidth() *float64 GetPaperHeight() *float64 GetMarginTop() *float64 GetMarginBottom() *float64 GetMarginLeft() *float64 GetMarginRight() *float64 GetPreferCSSPageSize() *bool }
Config is print config.
type DefaultPDFRenderConfig ¶
type DefaultPDFRenderConfig struct{}
DefaultPDFRenderConfig should be passed to Render if config not exists.
func (*DefaultPDFRenderConfig) GetDisplayHeaderFooter ¶
func (config *DefaultPDFRenderConfig) GetDisplayHeaderFooter() *bool
GetDisplayHeaderFooter return params GetDisplayHeaderFooter.
func (*DefaultPDFRenderConfig) GetFooterTemplate ¶
func (config *DefaultPDFRenderConfig) GetFooterTemplate() *string
GetFooterTemplate return params FooterTemplate.
func (*DefaultPDFRenderConfig) GetHeaderTemplate ¶
func (config *DefaultPDFRenderConfig) GetHeaderTemplate() *string
GetHeaderTemplate return params HeaderTemplate.
func (*DefaultPDFRenderConfig) GetLandscape ¶
func (config *DefaultPDFRenderConfig) GetLandscape() *bool
GetLandscape return params Landscape.
func (*DefaultPDFRenderConfig) GetMarginBottom ¶
func (config *DefaultPDFRenderConfig) GetMarginBottom() *float64
GetMarginBottom return params MarginBottom.
func (*DefaultPDFRenderConfig) GetMarginLeft ¶
func (config *DefaultPDFRenderConfig) GetMarginLeft() *float64
GetMarginLeft return params MarginLeft.
func (*DefaultPDFRenderConfig) GetMarginRight ¶
func (config *DefaultPDFRenderConfig) GetMarginRight() *float64
GetMarginRight return params MarginRight.
func (*DefaultPDFRenderConfig) GetMarginTop ¶
func (config *DefaultPDFRenderConfig) GetMarginTop() *float64
GetMarginTop return params MarginTop.
func (*DefaultPDFRenderConfig) GetPaperHeight ¶
func (config *DefaultPDFRenderConfig) GetPaperHeight() *float64
GetPaperHeight return params PaperHeight.
func (*DefaultPDFRenderConfig) GetPaperWidth ¶
func (config *DefaultPDFRenderConfig) GetPaperWidth() *float64
GetPaperWidth return params PaperWidth.
func (*DefaultPDFRenderConfig) GetPreferCSSPageSize ¶
func (config *DefaultPDFRenderConfig) GetPreferCSSPageSize() *bool
GetPreferCSSPageSize return params PreferCSSPageSize.
func (*DefaultPDFRenderConfig) GetPrintBackground ¶
func (config *DefaultPDFRenderConfig) GetPrintBackground() *bool
GetPrintBackground return params PrintBackground.
func (*DefaultPDFRenderConfig) GetScale ¶
func (config *DefaultPDFRenderConfig) GetScale() *float64
GetScale return params Scale.
type Document ¶
type Document struct { BodyHTML string HeaderHTML *string TemplateName TemplateName Assets http.FileSystem }
Document wrap HTML with template metadata.
type PDFRenderer ¶
type PDFRenderer interface { RenderPDF( ctx context.Context, config Config, document Document, ) ( []byte, error, ) Info(context.Context) (*RenderInfo, error) }
PDFRenderer interface.
type RenderInfo ¶
type RenderInfo struct { Pool RenderPoolInfo Metadata map[string]string }
RenderInfo contains pool info and metadata.
type RenderPoolInfo ¶
type RenderPoolInfo struct { Stats RenderPoolStats Type string }
RenderPoolInfo contains stats and type.
type RenderPoolStats ¶
RenderPoolStats container stats of render pool.