doctron_core

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DoctronHtml2Pdf     = 1
	DoctronHtml2Image   = 2
	DoctronPdf2Image    = 3
	DoctronPdfWatermark = 4
)
View Source
const DefaultDisplayHeaderFooter = false

DefaultDisplayHeaderFooter Display header and footer. Defaults to false.

View Source
const DefaultFooterTemplate = ""

DefaultFooterTemplate HTML template for the print footer. Should use the same format as the headerTemplate.

View Source
const DefaultFromSurface = true

DefaultFromSurface Capture the screenshot from the surface, rather than the view. Defaults to true.

View Source
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.

View Source
const DefaultIgnoreInvalidPageRanges = false

DefaultIgnoreInvalidPageRanges Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false.

View Source
const DefaultLandscape = false

DefaultLandscape Paper orientation. Defaults to false.

View Source
const DefaultMarginBottom = 0.4

DefaultMarginBottom Bottom margin in inches. Defaults to 1cm (~0.4 inches).

View Source
const DefaultMarginLeft = 0.4

DefaultMarginLeft Left margin in inches. Defaults to 1cm (~0.4 inches).

View Source
const DefaultMarginRight = 0.4

DefaultMarginRight Right margin in inches. Defaults to 1cm (~0.4 inches).

View Source
const DefaultMarginTop = 0.4

DefaultMarginTop Top margin in inches. Defaults to 1cm (~0.4 inches).

View Source
const DefaultPageRanges = ""

DefaultPageRanges Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.

View Source
const DefaultPaperHeight = 11

DefaultPaperHeight Paper height in inches. Defaults to 11 inches.

View Source
const DefaultPaperWidth = 8.5

DefaultPaperWidth Paper width in inches. Defaults to 8.5 inches.

View Source
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.

View Source
const DefaultPrintBackground = true

DefaultPrintBackground Print background graphics. Defaults to true.

View Source
const DefaultQuality = 0

DefaultQuality Compression quality from range [0..100] (jpeg only).

View Source
const DefaultScale = 1

DefaultScale Scale of the webpage rendering. Defaults to 1.

View Source
const DefaultViewportHeight = 996

DefaultViewportHeight Rectangle height in device independent pixels (dip).

View Source
const DefaultViewportScale = 1

DefaultViewportScale Page scale factor.

View Source
const DefaultViewportWidth = 996

DefaultViewportWidth Rectangle width in device independent pixels (dip).

View Source
const DefaultViewportX = 0

DefaultViewportX Capture the screenshot of a given region only. X offset in device independent pixels (dip).

View Source
const DefaultViewportY = 0

DefaultViewportY Y offset in device independent pixels (dip).

View Source
const DefaultWaitingTime = 0

DefaultWaitingTime Waiting time after the page loaded. Default 0 means not wait. unit:Millisecond

FormatJpeg Image compression format (defaults to png).

FormatPng Image compression format (defaults to png).

Variables

This section is empty.

Functions

This section is empty.

Types

type Doctron

type Doctron struct {
	// contains filtered or unexported fields
}

type DoctronFactory

type DoctronFactory interface {
	// contains filtered or unexported methods
}

type DoctronI

type DoctronI interface {
	converter.Converter
}

func NewDoctron

func NewDoctron(ctx context.Context, doctronType int, cc converter.ConvertConfig) DoctronI

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

type PdfWatermarkParams struct {
	WatermarkType int
	ImageUrl      string
}

func NewDefaultPdfWatermarkParams

func NewDefaultPdfWatermarkParams() PdfWatermarkParams

Jump to

Keyboard shortcuts

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