wkhtmltox

package
v1.0.4-C Latest Latest
Warning

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

Go to latest
Published: May 10, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConvertOptions

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

type CropOptions

type CropOptions struct {
	X int `json:"x"` // Set x coordinate for cropping
	Y int `json:"y"` // Set y coordinate for cropping
	H int `json:"h"` // Set height for cropping
	W int `json:"w"` // Set width for cropping
}

type ExtendParams

type ExtendParams map[string]string

type FetcherOptions

type FetcherOptions struct {
	Name   string          `json:"name"`   // http, oss, data
	Params json.RawMessage `json:"params"` // Optional
}

type FooterOptions

type FooterOptions struct {
	HtmlContent string `json:"html_content"`
}

type HeaderOptions

type HeaderOptions struct {
	HtmlContent string `json:"html_content"`
}

type MarginOptions

type MarginOptions struct {
	Top    string `json:"top"`
	Bottom string `json:"bottom"`
	Left   string `json:"left"`
	Right  string `json:"right"`
}

type Orientation

type Orientation string
const (
	Landscape Orientation = "Landscape"
	Portrait  Orientation = "Portrait"
)

type ToFormat

type ToFormat string

type ToImageOptions

type ToImageOptions struct {
	URI     string       `json:"uri"`
	Crop    CropOptions  `json:"crop"`    // Cropping options
	Format  string       `json:"format"`  // Image format, default is png
	Quality int          `json:"quality"` // Output image quality (between 0 and 100) (default 94)
	Width   int          `json:"width"`   // Default is 1024
	Height  int          `json:"height"`  // Set screen height (default is calculated from page content) (default 0)
	Extend  ExtendParams `json:"extend"`  // Other params
}

type ToPDFOptions

type ToPDFOptions struct {
	URI                    string        `json:"uri"`
	NoCollate              bool          `json:"no_collate"`       // Collate when printing multiple copies, default is true. --collate or --no-collate
	Copies                 int           `json:"copies"`           // Number of copies to print into the pdf default is 1
	GrayScale              bool          `json:"gray_scale"`       // PDF will be generated in grayscale
	LowQuality             bool          `json:"low_quality"`      // Generates lower quality pdf/ps. Useful to shrink the result document space
	Orientation            Orientation   `json:"orientation"`      // Set orientation to Landscape or Portrait (default Portrait)
	PageSize               string        `json:"page_size"`        // Set paper size to: A4, Letter, etc. (default A4)
	PrintMediaType         bool          `json:"print_media_type"` // Use print media-type instead of screen. --print-media-type or --no-print-media-type
	DisableJavascript      bool          `json:"disable_javascript"`
	DisableLocalFileAccess bool          `json:"disable_local_file_access"`
	Encoding               string        `json:"encoding"`
	Header                 HeaderOptions `json:"header"`
	Footer                 FooterOptions `json:"footer"`
	Margin                 MarginOptions `json:"margin"`
	Extend                 ExtendParams  `json:"extend"` // Other params
}

type WKHtmlToX

type WKHtmlToX struct {
	WkhtmlToImageExePath string
	WkhtmlToPdfExePath   string
	// contains filtered or unexported fields
}

func New

func New(conf config.Configuration) (wkHtmlToX *WKHtmlToX, err error)

func (*WKHtmlToX) Convert

func (p *WKHtmlToX) Convert(fetcherOpts FetcherOptions, convertOpts ConvertOptions) (ret []byte, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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