pdfrender

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package pdfrender contains HTML to PDF implementations

Index

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
	FooterHTML   *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

type RenderPoolStats struct {
	Active      int
	Idle        int
	Destroyed   int
	Invalidated int
}

RenderPoolStats container stats of render pool.

type TemplateName

type TemplateName string

TemplateName type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL