Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PrintArgs bool // print wkhtmltopdf args SaveProcessedHTMLTo string // save processed HTML to directory (used if not empty) )
View Source
var ( ErrBadStatus = errors.New("bad status") ErrNoQueryResult = errors.New("no result") ErrNoURL = errors.New("url is required") ErrBadURLScheme = errors.New("bad URL scheme") ErrInvalidPageSize = errors.New("invalid page size") )
Package errors.
Functions ¶
Types ¶
type IgnoredError ¶
type IgnoredError struct {
// contains filtered or unexported fields
}
IgnoredError returned just for logging.
func (*IgnoredError) Error ¶
func (e *IgnoredError) Error() string
Error is error interface implementation.
type Params ¶
type Params struct {
Query *string `json:"query,omitempty" desc:"elements to include in result document"` // css selector to be included in resulted PDF document
Remove *string `json:"remove,omitempty" desc:"elements to remove from result document"` // css selector of elements to be removed
NoBreakBefore *string `json:"no_break_before,omitempty" desc:"elements to disable break page before"` // css selector for elements to set break-before:avoid-page
NoBreakInside *string `json:"no_break_inside,omitempty" desc:"elements to disable break page inside"` // css selector for elements to set break-inside:avoid-page
NoBreakAfter *string `json:"no_break_after,omitempty" desc:"elements to disable break page after"` // css selector for elements to set break-after:avoid-page
CustomStyles *string `json:"custom_styles,omitempty" desc:"custom css stylesheet (will be included in <head>)"` // custom css styles to be injected into doc
WithContainers *bool `json:"with_containers,omitempty" desc:"preserve doc containers structure (useful when -query is set)"` // preserve all containert from document body to selector query result
ForceImageLoading *bool `json:"force_image_loading,omitempty" desc:"replace img[src} attribute value by value of data-src"` // replace img[src] by img[data-src] conetnt
// global options
Grayscale *bool `json:"grayscale,omitempty"`
MarginBottom *uint `json:"margin_bottom,omitempty"`
MarginLeft *uint `json:"margin_left,omitempty"`
MarginRight *uint `json:"margin_right,omitempty"`
MarginTop *uint `json:"margin_top,omitempty"`
Orientation *string `json:"orientation,omitempty"`
PageHeight *uint `json:"page_height,omitempty"`
PageWidth *uint `json:"page_width,omitempty"`
PageSize *string `json:"page_size,omitempty"`
Title *string `json:"title,omitempty"`
// page options
DisableExternalLinks *bool `json:"disable_external_links,omitempty"`
DisableInternalLinks *bool `json:"disable_internal_links,omitempty"`
EnableJavascript *bool `json:"enable_javascript,omitempty"`
NoBackground *bool `json:"no_background,omitempty"`
NoImages *bool `json:"no_images,omitempty"`
PageOffset *uint `json:"page_offset,omitempty"`
Zoom *float64 `json:"zoom,omitempty"`
ViewportSize *string `json:"viewport_size,omitempty"`
}
Params are used to tweak ToPDF output.
type URLError ¶
type URLError struct {
// contains filtered or unexported fields
}
URLError wraps error from url.Parse method.
type ValidationError ¶
type ValidationError struct {
Message string
}
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error is error interface implementation.
Click to show internal directories.
Click to hide internal directories.