mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
|
/*! For license information please see e629e34a.cfbd24b9.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:()=>x,frontMatter:()=>d,metadata:()=>l,toc:()=>h});var s=r(85893),i=r(11151);const d={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 o(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"pdfoptions-interface",children:"PDFOptions interface"}),"\n",(0,s.jsxs)(n.p,{children:["Valid options to configure PDF generation via ",(0,s.jsx)(n.a,{href:"/next/api/puppeteer.page.pdf",children:"Page.pdf()"}),"."]}),"\n",(0,s.jsx)(n.h4,{id:"signature",children:"Signature:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:"export interface PDFOptions\n"})}),"\n",(0,s.jsx)(n.h2,{id:"properties",children:"Properties"}),"\n",(0,s.jsxs)("table",{children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:(0,s.jsx)(n.p,{children:"Property"})}),(0,s.jsx)("th",{children:(0,s.jsx)(n.p,{children:"Modifiers"})}),(0,s.jsx)("th",{children:(0,s.jsx)(n.p,{children:"Type"})}),(0,s.jsx)("th",{children:(0,s.jsx)(n.p,{children:"Description"})}),(0,s.jsx)("th",{children:(0,s.jsx)(n.p,{children:"Default"})})]})}),(0,s.jsxs)("tbody",{children:[(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:(0,s.jsx)("span",{id:"displayheaderfooter",children:"displayHeaderFooter"})}),(0,s.jsx)("td",{children:(0,s.jsx)(n.p,{children:(0,s.jsx)(n.code,{children:"optional"})})}),(0,s.jsx)("td",{children:(0,s.jsx)(n.p,{children:"boolean"})}),(0,s.jsx)("td",{children:(0,s.jsx)(n.p,{children:"Whether to show the header and footer."})}),(0,s.jsx)("td",{children:(0,s.jsx)(n.p,{children:(0,s.jsx)(n.code,{children:"false"})})})]}),(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:(0,s.jsx)("span",{id:"footertemplate",children:"footerTemplate"})}),(0,s.jsx)("td",{children:(0,s.jsx)(n.p,{children:(0,s.jsx)(n.code,{children:"optional"})})}),(0,s.jsx)("td",{children:(0,s.jsx)(n.p,{children:"string"})}),(0,s.jsx)("td",{children:(0,s.jsxs)(n.p,{children:["HTML template for the print footer. Has the same constraints and support for special classes as ",(0,s.jsx)(n.a,{href:"/next/api/puppeteer.pdfoptions#headertemplate",children:"PDFOptions.headerTemplate"}),"."]})}),(0,s.jsx)("td",{})]}),(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:(0,s.jsx)("span",{id:"format",children:"format"})}),(0,s.jsx)("td",{children:(0,s.jsx)(n.p,{children:(0,s.jsx)(n.code,{children:"optional"})})}),(0,s.jsx)("td",{children:(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"/next/api/puppeteer.paperformat",children:"PaperFormat"})})}),(0,s.jsxs)("td",{children:[(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Remarks:"})}),(0,s.jsxs)(n.p,{children:["If set, this takes priority over the ",(0,s.jsx)(n.code,{children:"width"})," and ",(0,s.jsx)(n.code,{children:"height"})," options."]})]}),(0,s.jsx)("td",{children:(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"letter"}),"."]})})]}),(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:(0,s.jsx)("span",{id:"headertemplate",children:"headerTemplate"})}),(0,s.jsx)("td",{children:(0,s.jsx)(n.p,{children:(0,s.jsx)(n.code,{children:"optional"})})}),(0,s.jsx)("td",{children:(0,s.jsx)(n.p,{children:"string"})}),(0,s.jsxs)("td",{children:[(0,s.jsx)(n.p,{children:"HTML t
|