Documentation ¶
Index ¶
- Variables
- type Client
- type ConvertHTMLRequest
- func (req *ConvertHTMLRequest) Assets(assets ...Document)
- func (req ConvertHTMLRequest) EmulatedMediaType(mediaType string)
- func (req ConvertHTMLRequest) ExtraHttpHeaders(headers string)
- func (req ConvertHTMLRequest) ExtraLinkTags(link string)
- func (req ConvertHTMLRequest) FailOnConsoleExceptions(isFailOnConsoleExceptions bool)
- func (req ConvertHTMLRequest) Footer(footer Document)
- func (req ConvertHTMLRequest) Header(header Document)
- func (req ConvertHTMLRequest) Landscape(isLandscape bool)
- func (req ConvertHTMLRequest) Margins(margins [4]float64)
- func (req ConvertHTMLRequest) NativePageRanges(ranges string)
- func (req ConvertHTMLRequest) OmitBackground(isOmitBackground bool)
- func (req ConvertHTMLRequest) PDFFormat(format string)
- func (req ConvertHTMLRequest) PaperSize(size [2]float64)
- func (req ConvertHTMLRequest) PreferCssPageSize(isPreferCssPageSize bool)
- func (req ConvertHTMLRequest) PrintBackground(isPrintBackground bool)
- func (req ConvertHTMLRequest) Scale(scaleFactor float64)
- func (req ConvertHTMLRequest) UserAgent(agent string)
- func (req ConvertHTMLRequest) WaitDelay(d time.Duration)
- func (req ConvertHTMLRequest) WaitForExpression(expression string)
- type Document
- type MergeRequest
- func (req MergeRequest) AddWebhookURLHTTPHeader(key, value string)
- func (req MergeRequest) ResultFilename(filename string)
- func (req MergeRequest) WaitTimeout(timeout float64)
- func (req MergeRequest) WebhookErrorMethod(method string)
- func (req MergeRequest) WebhookErrorURL(url string)
- func (req MergeRequest) WebhookExtraHeaders(headers string)
- func (req MergeRequest) WebhookMethod(method string)
- func (req MergeRequest) WebhookURL(url string)
- type OfficeRequest
- func (req OfficeRequest) AddWebhookURLHTTPHeader(key, value string)
- func (req *OfficeRequest) Landscape(isLandscape bool)
- func (req *OfficeRequest) Merge(merge bool)
- func (req *OfficeRequest) NativePDFFormat(pdfFormat string)
- func (req *OfficeRequest) PDFFormat(pdfFormat string)
- func (req *OfficeRequest) PageRanges(ranges string)
- func (req OfficeRequest) ResultFilename(filename string)
- func (req OfficeRequest) WaitTimeout(timeout float64)
- func (req OfficeRequest) WebhookErrorMethod(method string)
- func (req OfficeRequest) WebhookErrorURL(url string)
- func (req OfficeRequest) WebhookExtraHeaders(headers string)
- func (req OfficeRequest) WebhookMethod(method string)
- func (req OfficeRequest) WebhookURL(url string)
- type Request
Constants ¶
This section is empty.
Variables ¶
var ( // A0 paper size. A0 = [2]float64{33.1, 46.8} // A1 paper size. A1 = [2]float64{23.4, 33.1} // A2 paper size. A2 = [2]float64{16.54, 23.4} // A3 paper size. A3 = [2]float64{11.7, 16.5} // A4 paper size. A4 = [2]float64{8.27, 11.7} // A5 paper size. A5 = [2]float64{5.8, 8.3} // A6 paper size. A6 = [2]float64{4.1, 5.8} // Letter paper size. Letter = [2]float64{8.5, 11} // Legal paper size. Legal = [2]float64{8.5, 14} // Tabloid paper size. Tabloid = [2]float64{11, 17} // Ledger paper size. Ledger = [2]float64{17, 11} )
Paper Sizes
var ( // NoMargins removes margins. NoMargins = [4]float64{0, 0, 0, 0} // NormalMargins uses 1 inche margins. NormalMargins = [4]float64{1, 1, 1, 1} // LargeMargins uses 2 inche margins. LargeMargins = [4]float64{2, 2, 2, 2} )
nolint:gochecknoglobals
Functions ¶
This section is empty.
Types ¶
type ConvertHTMLRequest ¶
type ConvertHTMLRequest struct {
// contains filtered or unexported fields
}
func NewConvertHTMLRequest ¶
func NewConvertHTMLRequest(index Document) *ConvertHTMLRequest
func (*ConvertHTMLRequest) Assets ¶
func (req *ConvertHTMLRequest) Assets(assets ...Document)
Assets sets assets form files.
func (ConvertHTMLRequest) EmulatedMediaType ¶
func (req ConvertHTMLRequest) EmulatedMediaType(mediaType string)
EmulatedMediaType sets emulatedMediaType form field
func (ConvertHTMLRequest) ExtraHttpHeaders ¶
func (req ConvertHTMLRequest) ExtraHttpHeaders(headers string)
ExtraHttpHeaders sets extraHttpHeaders form field e.g.: extraHttpHeaders="{\"MyHeader\": \"MyValue\"}"
func (ConvertHTMLRequest) ExtraLinkTags ¶ added in v1.2.0
func (req ConvertHTMLRequest) ExtraLinkTags(link string)
ExtraLinkTags set up custom tags! example:'extraLinkTags="[{\"href\":\"https://my.cdn.css\"}]"'
func (ConvertHTMLRequest) FailOnConsoleExceptions ¶
func (req ConvertHTMLRequest) FailOnConsoleExceptions(isFailOnConsoleExceptions bool)
FailOnConsoleExceptions sets failOnConsoleExceptions form field
func (ConvertHTMLRequest) Footer ¶
func (req ConvertHTMLRequest) Footer(footer Document)
Footer sets footer form file.
func (ConvertHTMLRequest) Header ¶
func (req ConvertHTMLRequest) Header(header Document)
Header sets header form file.
func (ConvertHTMLRequest) Landscape ¶
func (req ConvertHTMLRequest) Landscape(isLandscape bool)
Landscape sets landscape form field.
func (ConvertHTMLRequest) Margins ¶
func (req ConvertHTMLRequest) Margins(margins [4]float64)
Margins sets marginTop, marginBottom, marginLeft and marginRight form fields.
func (ConvertHTMLRequest) NativePageRanges ¶
func (req ConvertHTMLRequest) NativePageRanges(ranges string)
NativePageRanges sets pageRanges form field.
func (ConvertHTMLRequest) OmitBackground ¶
func (req ConvertHTMLRequest) OmitBackground(isOmitBackground bool)
OmitBackground sets omitBackground form field
func (ConvertHTMLRequest) PDFFormat ¶
func (req ConvertHTMLRequest) PDFFormat(format string)
PDFFormat sets pdfFormat form field
func (ConvertHTMLRequest) PaperSize ¶
func (req ConvertHTMLRequest) PaperSize(size [2]float64)
PaperSize sets paperWidth and paperHeight form fields.
func (ConvertHTMLRequest) PreferCssPageSize ¶
func (req ConvertHTMLRequest) PreferCssPageSize(isPreferCssPageSize bool)
PreferCssPageSize sets preferCssPageSize form field
func (ConvertHTMLRequest) PrintBackground ¶
func (req ConvertHTMLRequest) PrintBackground(isPrintBackground bool)
PrintBackground sets printBackground form field
func (ConvertHTMLRequest) Scale ¶
func (req ConvertHTMLRequest) Scale(scaleFactor float64)
Scale sets scale form field
func (ConvertHTMLRequest) UserAgent ¶
func (req ConvertHTMLRequest) UserAgent(agent string)
UserAgent sets userAgent form field e.g.: userAgent="Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38
(KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1"
func (ConvertHTMLRequest) WaitForExpression ¶
func (req ConvertHTMLRequest) WaitForExpression(expression string)
WaitForExpression sets waitForExpression form field
type Document ¶
type Document interface { Filename() string Reader() (io.ReadCloser, error) }
func NewDocumentFromBytes ¶
NewDocumentFromBytes creates a Document from bytes.
func NewDocumentFromPath ¶
NewDocumentFromPath creates a Document from a file path.
func NewDocumentFromString ¶
NewDocumentFromString creates a Document from a string.
type MergeRequest ¶ added in v1.3.0
type MergeRequest struct {
// contains filtered or unexported fields
}
MergeRequest facilitates merging PDF with the Gotenberg API.
func NewMergeRequest ¶ added in v1.3.0
func NewMergeRequest(pdfs ...Document) *MergeRequest
NewMergeRequest create MergeRequest.
func (MergeRequest) AddWebhookURLHTTPHeader ¶ added in v1.3.0
func (req MergeRequest) AddWebhookURLHTTPHeader(key, value string)
AddWebhookURLHTTPHeader add a webhook custom HTTP header.
func (MergeRequest) ResultFilename ¶ added in v1.3.0
func (req MergeRequest) ResultFilename(filename string)
ResultFilename sets resultFilename form field.
func (MergeRequest) WaitTimeout ¶ added in v1.3.0
func (req MergeRequest) WaitTimeout(timeout float64)
WaitTimeout sets waitTimeout form field.
func (MergeRequest) WebhookErrorMethod ¶ added in v1.3.0
func (req MergeRequest) WebhookErrorMethod(method string)
WebhookErrorMethod sets webhookErrorURL HTTP header.
func (MergeRequest) WebhookErrorURL ¶ added in v1.3.0
func (req MergeRequest) WebhookErrorURL(url string)
WebhookErrorURL sets webhookErrorURL HTTP header.
func (MergeRequest) WebhookExtraHeaders ¶ added in v1.3.0
func (req MergeRequest) WebhookExtraHeaders(headers string)
WebhookExtraHeaders sets webhookExtraHeaders HTTP header.
func (MergeRequest) WebhookMethod ¶ added in v1.3.0
func (req MergeRequest) WebhookMethod(method string)
WebhookMethod sets webhookMethod HTTP header.
func (MergeRequest) WebhookURL ¶ added in v1.3.0
func (req MergeRequest) WebhookURL(url string)
WebhookURL sets webhookURL HTTP header.
type OfficeRequest ¶ added in v1.1.0
type OfficeRequest struct {
// contains filtered or unexported fields
}
func NewOfficeRequest ¶ added in v1.1.0
func NewOfficeRequest(docs ...Document) *OfficeRequest
func (OfficeRequest) AddWebhookURLHTTPHeader ¶ added in v1.1.0
func (req OfficeRequest) AddWebhookURLHTTPHeader(key, value string)
AddWebhookURLHTTPHeader add a webhook custom HTTP header.
func (*OfficeRequest) Landscape ¶ added in v1.1.0
func (req *OfficeRequest) Landscape(isLandscape bool)
Landscape sets landscape form field.
func (*OfficeRequest) Merge ¶ added in v1.1.0
func (req *OfficeRequest) Merge(merge bool)
Merge sets merge form field.
func (*OfficeRequest) NativePDFFormat ¶ added in v1.1.0
func (req *OfficeRequest) NativePDFFormat(pdfFormat string)
NativePDFFormat sets nativePdfFormat form field.
func (*OfficeRequest) PDFFormat ¶ added in v1.1.0
func (req *OfficeRequest) PDFFormat(pdfFormat string)
PDFFormat sets pdfFormat form field.
func (*OfficeRequest) PageRanges ¶ added in v1.1.0
func (req *OfficeRequest) PageRanges(ranges string)
PageRanges sets pageRanges form field.
func (OfficeRequest) ResultFilename ¶ added in v1.1.0
func (req OfficeRequest) ResultFilename(filename string)
ResultFilename sets resultFilename form field.
func (OfficeRequest) WaitTimeout ¶ added in v1.1.0
func (req OfficeRequest) WaitTimeout(timeout float64)
WaitTimeout sets waitTimeout form field.
func (OfficeRequest) WebhookErrorMethod ¶ added in v1.1.0
func (req OfficeRequest) WebhookErrorMethod(method string)
WebhookErrorMethod sets webhookErrorURL HTTP header.
func (OfficeRequest) WebhookErrorURL ¶ added in v1.1.0
func (req OfficeRequest) WebhookErrorURL(url string)
WebhookErrorURL sets webhookErrorURL HTTP header.
func (OfficeRequest) WebhookExtraHeaders ¶ added in v1.1.0
func (req OfficeRequest) WebhookExtraHeaders(headers string)
WebhookExtraHeaders sets webhookExtraHeaders HTTP header.
func (OfficeRequest) WebhookMethod ¶ added in v1.1.0
func (req OfficeRequest) WebhookMethod(method string)
WebhookMethod sets webhookMethod HTTP header.
func (OfficeRequest) WebhookURL ¶ added in v1.1.0
func (req OfficeRequest) WebhookURL(url string)
WebhookURL sets webhookURL HTTP header.