Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- type ClientOptions
- func WithFile(name string, r io.Reader) ClientOptions
- func WithLandscape(enabled bool) ClientOptions
- func WithMargins(top, right, bottom, left float64) ClientOptions
- func WithOutputFilename(filename string) ClientOptions
- func WithPaperSize(width, height float64) ClientOptions
- func WithPaperSizeA4() ClientOptions
- func WithPaperSizeLetter() ClientOptions
- func WithPrintBackground(enabled bool) ClientOptions
- func WithScale(scale float64) ClientOptions
- func WithSinglePage(enabled bool) ClientOptions
- func WithWebhookError(errorURL, errorMethod string) ClientOptions
- func WithWebhookExtraHeader(name, value string) ClientOptions
- func WithWebhookSuccess(url, method string) ClientOptions
Constants ¶
View Source
const ( FieldSinglePage = "singlePage" FieldPaperWidth = "paperWidth" FieldPaperHeight = "paperHeight" FieldMarginTop = "marginTop" FieldMarginBottom = "marginBottom" FieldMarginLeft = "marginLeft" FieldMarginRight = "marginRight" FieldPreferCSSPageSize = "preferCssPageSize" FieldGenerateDocumentOutline = "generateDocumentOutline" FieldGenerateTaggedPDF = "generateTaggedPdf" FieldPrintBackground = "printBackground" FieldOmitBackground = "omitBackground" FieldLandscape = "landscape" FieldScale = "scale" FieldNativePageRanges = "nativePageRanges" )
View Source
const ( HeaderWebhookURL = "Gotenberg-Webhook-Url" HeaderWebhookErrorURL = "Gotenberg-Webhook-Error-Url" HeaderWebhookMethod = "Gotenberg-Webhook-Method" HeaderWebhookErrorMethod = "Gotenberg-Webhook-Error-Method" HeaderWebhookExtraHTTPHeaders = "Gotenberg-Webhook-Extra-Http-Headers" )
Variables ¶
View Source
var ( PaperSizeLetter = [2]float64{8.5, 11} PaperSizeLegal = [2]float64{8.5, 14} PaperSizeTabloid = [2]float64{11, 17} PaperSizeLedger = [2]float64{17, 11} PaperSizeA0 = [2]float64{33.1, 46.8} PaperSizeA1 = [2]float64{23.4, 33.1} PaperSizeA2 = [2]float64{16.54, 23.4} PaperSizeA3 = [2]float64{11.7, 16.54} PaperSizeA4 = [2]float64{8.27, 11.7} PaperSizeA5 = [2]float64{5.83, 8.27} PaperSizeA6 = [2]float64{4.13, 5.83} )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ConvertHTMLToPDF ¶
func (*Client) ConvertURLToPDF ¶
type ClientOptions ¶ added in v0.1.1
type ClientOptions func(*clientOptions)
func WithLandscape ¶
func WithLandscape(enabled bool) ClientOptions
func WithMargins ¶
func WithMargins(top, right, bottom, left float64) ClientOptions
func WithOutputFilename ¶
func WithOutputFilename(filename string) ClientOptions
func WithPaperSize ¶
func WithPaperSize(width, height float64) ClientOptions
func WithPaperSizeA4 ¶ added in v0.0.3
func WithPaperSizeA4() ClientOptions
func WithPaperSizeLetter ¶ added in v0.0.3
func WithPaperSizeLetter() ClientOptions
func WithPrintBackground ¶
func WithPrintBackground(enabled bool) ClientOptions
func WithScale ¶
func WithScale(scale float64) ClientOptions
func WithSinglePage ¶
func WithSinglePage(enabled bool) ClientOptions
func WithWebhookError ¶ added in v0.1.0
func WithWebhookError(errorURL, errorMethod string) ClientOptions
func WithWebhookExtraHeader ¶ added in v0.1.0
func WithWebhookExtraHeader(name, value string) ClientOptions
func WithWebhookSuccess ¶ added in v0.1.0
func WithWebhookSuccess(url, method string) ClientOptions
Directories
¶
| Path | Synopsis |
|---|---|
|
example
|
|
|
cmd/html2pdf
command
|
|
|
cmd/html2pdf_minimal
command
|
|
|
cmd/html2pdf_webhook
command
|
|
|
cmd/url2pdf
command
|
|
Click to show internal directories.
Click to hide internal directories.