メインコンテンツへ飛ぶ

PrintToPDFOptions Object

  • landscape boolean (optional) - Paper orientation.true for landscape, false for portrait. 省略値は、false です。
  • displayHeaderFooter boolean (optional) - Whether to display header and footer. 省略値は、false です。
  • printBackground boolean (optional) - Whether to print background graphics. 省略値は、false です。
  • scale number(optional) - Scale of the webpage rendering. 省略値は 1 です。
  • pageSize string | Size (optional) - Specify page size of the generated PDF. Can be A0, A1, A2, A3, A4, A5, A6, Legal, Letter, Tabloid, Ledger, or an Object containing height and width in inches. Defaults to Letter.
  • margins PrintToPDFMargins (optional)
    • top number (optional) - Top margin in inches. 省略値は 1cm (約 0.4 インチ) です。
    • bottom number (optional) - Bottom margin in inches. 省略値は 1cm (約 0.4 インチ) です。
    • left number (optional) - Left margin in inches. 省略値は 1cm (約 0.4 インチ) です。
    • right number (optional) - Right margin in inches. 省略値は 1cm (約 0.4 インチ) です。
  • pageRanges string (optional) - Page ranges to print, e.g., '1-5, 8, 11-13'. 省略値は空の文字列で、これは全ページを印刷します。
  • headerTemplate string (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) and totalPages (total pages in the document). For example, <span class=title></span> would generate span containing the title.
  • footerTemplate string (optional) - HTML template for the print footer. Should use the same format as the headerTemplate.
  • preferCSSPageSize boolean (optional) - Whether or not to prefer page size as defined by css. 省略値は false で、その場合コンテンツは用紙サイズに合うように拡大縮小されます。
  • generateTaggedPDF boolean (optional) Experimental - Whether or not to generate a tagged (accessible) PDF. 省略値は、false です。 このプロパティは実験的なものであるため、生成された PDF は PDF/UA および WCAG 標準に完全に準拠していないおそれがあります。
  • generateDocumentOutline boolean (optional) Experimental - Whether or not to generate a PDF document outline from content headers. 省略値は、false です。