PrintToPDFOptions Object
landscapeboolean (optional) - Paper orientation.truefor landscape,falsefor portrait. Defaults to false.displayHeaderFooterboolean (optional) - Whether to display header and footer. Defaults to false.printBackgroundboolean (optional) - Whether to print background graphics. Defaults to false.scalenumber(optional) - Scale of the webpage rendering. Defaults to 1.pageSizestring | Size (optional) - Specify page size of the generated PDF. Can beA0,A1,A2,A3,A4,A5,A6,Legal,Letter,Tabloid,Ledger, or an Object containingheightandwidthin inches. Defaults toLetter.marginsPrintToPDFMargins (optional)topnumber (optional) - Top margin in inches. Defaults to 1cm (~0.4 inches).bottomnumber (optional) - Bottom margin in inches. Defaults to 1cm (~0.4 inches).leftnumber (optional) - Left margin in inches. Defaults to 1cm (~0.4 inches).rightnumber (optional) - Right margin in inches. Defaults to 1cm (~0.4 inches).
pageRangesstring (optional) - Page ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.headerTemplatestring (optional) - HTML template for the print header. 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) andtotalPages(total pages in the document). For example,<span class=title></span>would generate span containing the title.footerTemplatestring (optional) - HTML template for the print footer. Should use the same format as theheaderTemplate.preferCSSPageSizeboolean (optional) - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.generateTaggedPDFboolean (optional) Experimental - Whether or not to generate a tagged (accessible) PDF. Defaults to false. As this property is experimental, the generated PDF may not adhere fully to PDF/UA and WCAG standards.generateDocumentOutlineboolean (optional) Experimental - Whether or not to generate a PDF document outline from content headers. Defaults to false.