Documentation ¶
Index ¶
Constants ¶
const ( DoctronHtml2Pdf = 1 DoctronHtml2Image = 2 DoctronPdf2Image = 3 DoctronPdfWatermark = 4 )
DefaultDisplayHeaderFooter Display header and footer. Defaults to false.
DefaultFooterTemplate HTML template for the print footer. Should use the same format as the headerTemplate.
const DefaultFromSurface = true
DefaultFromSurface Capture the screenshot from the surface, rather than the view. Defaults to true.
const DefaultHeaderTemplate = ""
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
DefaultIgnoreInvalidPageRanges Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false.
const DefaultLandscape = false
DefaultLandscape Paper orientation. Defaults to false.
const DefaultMarginBottom = 0.4
DefaultMarginBottom Bottom margin in inches. Defaults to 1cm (~0.4 inches).
const DefaultMarginLeft = 0.4
DefaultMarginLeft Left margin in inches. Defaults to 1cm (~0.4 inches).
const DefaultMarginRight = 0.4
DefaultMarginRight Right margin in inches. Defaults to 1cm (~0.4 inches).
const DefaultMarginTop = 0.4
DefaultMarginTop Top margin in inches. Defaults to 1cm (~0.4 inches).
const DefaultPageRanges = ""
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
DefaultPaperHeight Paper height in inches. Defaults to 11 inches.
const DefaultPaperWidth = 8.5
DefaultPaperWidth Paper width in inches. Defaults to 8.5 inches.
const DefaultPreferCSSPageSize = false
DefaultPreferCSSPageSize 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
DefaultPrintBackground Print background graphics. Defaults to true.
const DefaultQuality = 0
DefaultQuality Compression quality from range [0..100] (jpeg only).
const DefaultScale = 1
DefaultScale Scale of the webpage rendering. Defaults to 1.
const DefaultViewportHeight = 996
DefaultViewportHeight Rectangle height in device independent pixels (dip).
const DefaultViewportScale = 1
DefaultViewportScale Page scale factor.
const DefaultViewportWidth = 996
DefaultViewportWidth Rectangle width in device independent pixels (dip).
const DefaultViewportX = 0
DefaultViewportX Capture the screenshot of a given region only. X offset in device independent pixels (dip).
const DefaultViewportY = 0
DefaultViewportY Y offset in device independent pixels (dip).
const DefaultWaitingTime = 0
DefaultWaitingTime Waiting time after the page loaded. Default 0 means not wait. unit:Millisecond
const FormatJpeg = page.CaptureScreenshotFormatJpeg
FormatJpeg Image compression format (defaults to png).
const FormatPng = page.CaptureScreenshotFormatPng
FormatPng 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 WaitingTime int // Waiting time after the page loaded. Default 0 means not wait. unit:Millisecond }
Html2ImageParams print page as PDF.
func NewDefaultHtml2ImageParams ¶
func NewDefaultHtml2ImageParams() Html2ImageParams
NewDefaultHtml2ImageParams default html convert to image params
type PDFParams ¶
type PDFParams struct { page.PrintToPDFParams WaitingTime int // Waiting time after the page loaded. Default 0 means not wait. unit:Millisecond }
PDFParams print page as PDF.
func NewDefaultPDFParams ¶
func NewDefaultPDFParams() PDFParams
NewDefaultPDFParams default pdf params
type PdfWatermarkParams ¶
func NewDefaultPdfWatermarkParams ¶
func NewDefaultPdfWatermarkParams() PdfWatermarkParams