doctron_core

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 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

Display header and footer. Defaults to false.

View Source
const DefaultFooterTemplate = ""

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

View Source
const DefaultFromSurface = true

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

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

View Source
const DefaultIgnoreInvalidPageRanges = false

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

View Source
const DefaultLandscape = false

Paper orientation. Defaults to false.

View Source
const DefaultMarginBottom = 0.4

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

View Source
const DefaultMarginLeft = 0.4

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

View Source
const DefaultMarginRight = 0.4

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

View Source
const DefaultMarginTop = 0.4

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

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

Paper height in inches. Defaults to 11 inches.

View Source
const DefaultPaperWidth = 8.5

Paper width in inches. Defaults to 8.5 inches.

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

View Source
const DefaultPrintBackground = true

Print background graphics. Defaults to true.

View Source
const DefaultQuality = 0

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

View Source
const DefaultScale = 1

Scale of the webpage rendering. Defaults to 1.

View Source
const DefaultViewportHeight = 996

Rectangle height in device independent pixels (dip).

View Source
const DefaultViewportScale = 1

Page scale factor.

View Source
const DefaultViewportWidth = 996

Rectangle width in device independent pixels (dip).

View Source
const DefaultViewportX = 0

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

View Source
const DefaultViewportY = 0

Y offset in device independent pixels (dip).

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
}

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

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