Documentation
¶
Index ¶
Constants ¶
const ( DoctronHtml2Pdf = 1 DoctronHtml2Image = 2 DoctronPdf2Image = 3 DoctronPdfWatermark = 4 )
Display header and footer. Defaults to false.
HTML template for the print footer. Should use the same format as the headerTemplate.
const DefaultFromSurface = true
Capture the screenshot from the surface, rather than the view. Defaults to true.
const DefaultHeaderTemplate = ""
HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: - date: formatted print date - title: document title - url: document location - pageNumber: current page number - totalPages: total pages in the document For example, <span class=title></span> would generate span containing the title.
const DefaultIgnoreInvalidPageRanges = false
Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false.
const DefaultLandscape = false
Paper orientation. Defaults to false.
const DefaultMarginBottom = 0.4
Bottom margin in inches. Defaults to 1cm (~0.4 inches).
const DefaultMarginLeft = 0.4
Left margin in inches. Defaults to 1cm (~0.4 inches).
const DefaultMarginRight = 0.4
Right margin in inches. Defaults to 1cm (~0.4 inches).
const DefaultMarginTop = 0.4
Top margin in inches. Defaults to 1cm (~0.4 inches).
const DefaultPageRanges = ""
Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
const DefaultPaperHeight = 11
Paper height in inches. Defaults to 11 inches.
const DefaultPaperWidth = 8.5
Paper width in inches. Defaults to 8.5 inches.
const DefaultPreferCSSPageSize = false
Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
const DefaultPrintBackground = true
Print background graphics. Defaults to true.
const DefaultQuality = 0
Compression quality from range [0..100] (jpeg only).
const DefaultScale = 1
Scale of the webpage rendering. Defaults to 1.
const DefaultViewportHeight = 996
Rectangle height in device independent pixels (dip).
const DefaultViewportScale = 1
Page scale factor.
const DefaultViewportWidth = 996
Rectangle width in device independent pixels (dip).
const DefaultViewportX = 0
Capture the screenshot of a given region only. X offset in device independent pixels (dip).
const DefaultViewportY = 0
Y offset in device independent pixels (dip).
const FormatJpeg = page.CaptureScreenshotFormatJpeg
const FormatPng = page.CaptureScreenshotFormatPng
Image compression format (defaults to png).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DoctronFactory ¶
type DoctronFactory interface {
// contains filtered or unexported methods
}
type DoctronI ¶
func NewDoctron ¶
new doctron
type Html2ImageParams ¶
type Html2ImageParams struct { page.CaptureScreenshotParams CustomClip bool }
PrintToHtml2Image print page as PDF.
func NewDefaultHtml2ImageParams ¶
func NewDefaultHtml2ImageParams() Html2ImageParams
type PDFParams ¶
type PDFParams struct {
page.PrintToPDFParams
}
PrintToPDFParams print page as PDF.
func NewDefaultPDFParams ¶
func NewDefaultPDFParams() PDFParams
type PdfWatermarkParams ¶
func NewDefaultPdfWatermarkParams ¶
func NewDefaultPdfWatermarkParams() PdfWatermarkParams