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) 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 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) 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.