github.com/MontFerret/ferret@v0.18.0/pkg/drivers/pdf.go (about) 1 package drivers 2 3 import "github.com/MontFerret/ferret/pkg/runtime/values" 4 5 // PDFParams represents the arguments for PrintToPDF function. 6 type PDFParams struct { 7 // Paper orientation. Defaults to false. 8 Landscape values.Boolean 9 // Display values and footer. Defaults to false. 10 DisplayHeaderFooter values.Boolean 11 // Print background graphics. Defaults to false. 12 PrintBackground values.Boolean 13 // Scale of the webpage rendering. Defaults to 1. 14 Scale values.Float 15 // Paper width in inches. Defaults to 8.5 inches. 16 PaperWidth values.Float 17 // Paper height in inches. Defaults to 11 inches. 18 PaperHeight values.Float 19 // Top margin in inches. Defaults to 1cm (~0.4 inches). 20 MarginTop values.Float 21 // Bottom margin in inches. Defaults to 1cm (~0.4 inches). 22 MarginBottom values.Float 23 // Left margin in inches. Defaults to 1cm (~0.4 inches). 24 MarginLeft values.Float 25 // Right margin in inches. Defaults to 1cm (~0.4 inches). 26 MarginRight values.Float 27 // Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages. 28 PageRanges values.String 29 // HTML template for the print values. Should be valid HTML markup with following classes used to inject printing values into them: - `date`: formatted print date - `title`: document title - `url`: document location - `pageNumber`: current page number - `totalPages`: total pages in the document 30 // For example, `<span class=title></span>` would generate span containing the title. 31 HeaderTemplate values.String 32 // HTML template for the print footer. Should use the same format as the `headerTemplate`. 33 FooterTemplate values.String 34 // Whether or not to prefer page size as defined by css. 35 // Defaults to false, in which case the content will be scaled to fit the paper size. 36 PreferCSSPageSize values.Boolean 37 }