puppeteer/assets/js/e629e34a.9bf02721.js

2 lines
12 KiB
JavaScript
Raw Normal View History

/*! For license information please see e629e34a.9bf02721.js.LICENSE.txt */
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[42822],{87249:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>c,contentTitle:()=>t,default:()=>p,frontMatter:()=>s,metadata:()=>l,toc:()=>h});var d=r(85893),i=r(11151);const s={sidebar_label:"PDFOptions"},t="PDFOptions interface",l={id:"api/puppeteer.pdfoptions",title:"PDFOptions interface",description:"Valid options to configure PDF generation via Page.pdf().",source:"@site/../docs/api/puppeteer.pdfoptions.md",sourceDirName:"api",slug:"/api/puppeteer.pdfoptions",permalink:"/next/api/puppeteer.pdfoptions",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"PDFOptions"},sidebar:"api",previous:{title:"PDFMargin",permalink:"/next/api/puppeteer.pdfmargin"},next:{title:"Permission",permalink:"/next/api/puppeteer.permission"}},c={},h=[{value:"Signature:",id:"signature",level:4},{value:"Properties",id:"properties",level:2}];function x(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h4:"h4",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.a)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.h1,{id:"pdfoptions-interface",children:"PDFOptions interface"}),"\n",(0,d.jsxs)(n.p,{children:["Valid options to configure PDF generation via ",(0,d.jsx)(n.a,{href:"/next/api/puppeteer.page.pdf",children:"Page.pdf()"}),"."]}),"\n",(0,d.jsx)(n.h4,{id:"signature",children:"Signature:"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-typescript",children:"export interface PDFOptions\n"})}),"\n",(0,d.jsx)(n.h2,{id:"properties",children:"Properties"}),"\n",(0,d.jsxs)("table",{children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{children:(0,d.jsx)(n.p,{children:"Property"})}),(0,d.jsx)("th",{children:(0,d.jsx)(n.p,{children:"Modifiers"})}),(0,d.jsx)("th",{children:(0,d.jsx)(n.p,{children:"Type"})}),(0,d.jsx)("th",{children:(0,d.jsx)(n.p,{children:"Description"})}),(0,d.jsx)("th",{children:(0,d.jsx)(n.p,{children:"Default"})})]})}),(0,d.jsxs)("tbody",{children:[(0,d.jsxs)("tr",{children:[(0,d.jsx)("td",{children:(0,d.jsx)(n.p,{children:"displayHeaderFooter"})}),(0,d.jsx)("td",{children:(0,d.jsx)(n.p,{children:(0,d.jsx)(n.code,{children:"optional"})})}),(0,d.jsx)("td",{children:(0,d.jsx)(n.p,{children:"boolean"})}),(0,d.jsx)("td",{children:(0,d.jsx)(n.p,{children:"Whether to show the header and footer."})}),(0,d.jsx)("td",{children:(0,d.jsx)(n.p,{children:(0,d.jsx)(n.code,{children:"false"})})})]}),(0,d.jsxs)("tr",{children:[(0,d.jsx)("td",{children:(0,d.jsx)(n.p,{children:"footerTemplate"})}),(0,d.jsx)("td",{children:(0,d.jsx)(n.p,{children:(0,d.jsx)(n.code,{children:"optional"})})}),(0,d.jsx)("td",{children:(0,d.jsx)(n.p,{children:"string"})}),(0,d.jsx)("td",{children:(0,d.jsxs)(n.p,{children:["HTML template for the print footer. Has the same constraints and support for special classes as ",(0,d.jsx)(n.a,{href:"/next/api/puppeteer.pdfoptions",children:"PDFOptions.headerTemplate"}),"."]})}),(0,d.jsx)("td",{})]}),(0,d.jsxs)("tr",{children:[(0,d.jsx)("td",{children:(0,d.jsx)(n.p,{children:"format"})}),(0,d.jsx)("td",{children:(0,d.jsx)(n.p,{children:(0,d.jsx)(n.code,{children:"optional"})})}),(0,d.jsx)("td",{children:(0,d.jsx)(n.p,{children:(0,d.jsx)(n.a,{href:"/next/api/puppeteer.paperformat",children:"PaperFormat"})})}),(0,d.jsx)("td",{}),(0,d.jsx)("td",{children:(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"letter"}),"."]})})]}),(0,d.jsxs)("tr",{children:[(0,d.jsx)("td",{children:(0,d.jsx)(n.p,{children:"headerTemplate"})}),(0,d.jsx)("td",{children:(0,d.jsx)(n.p,{children:(0,d.jsx)(n.code,{children:"optional"})})}),(0,d.jsx)("td",{children:(0,d.jsx)(n.p,{children:"string"})}),(0,d.jsxs)("td",{children:[(0,d.jsx)(n.p,{children:"HTML template for the print header. Should be valid HTML with the following classes used to inject values into them:"}),(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"date"})," formatted print date"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"title