[{"data":1,"prerenderedAt":890},["Reactive",2],{"/guides/invoice-pdf-from-html":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"dateModified":10,"author":11,"faq":12,"body":31,"_type":885,"_id":886,"_source":887,"_file":888,"_extension":889},"/guides/invoice-pdf-from-html","guides",false,"","HTML Invoice to PDF: Multi-Page Invoices with an API","Turn an HTML invoice into a PDF with one API call. use_print alone still cut rows and totals in our test. Add two CSS rules: 150 lines, 8 clean pages.","2026-12-01","Cyril Nicodème",[13,16,19,22,25,28],{"question":14,"answer":15},"Can I get a link to the invoice instead of the PDF file?","Yes. Add a filename of at least 7 characters (letters, digits, - and _) and the response becomes JSON with a url to the PDF, kept for 2 days. To keep it longer, send it to your own S3 bucket with s3_destination.",{"question":17,"answer":18},"How do I email the invoice to my customer?","The response body is the PDF file itself, so attach those bytes to your email as invoice.pdf with your usual mail library or email API. If you'd rather send a link, add a filename and email the url that comes back.",{"question":20,"answer":21},"Can I convert my invoice page's URL instead of sending the HTML?","Yes. Put the address in source and PDFShift loads the page and converts it, with the same parameters.",{"question":23,"answer":24},"Can I generate a whole month of invoices at once?","Yes. Send one request per invoice with a webhook URL. Each call is queued at once and PDFShift posts a link to each finished PDF to your server.",{"question":26,"answer":27},"Does Letter paper change the page count?","Not for our 40-line invoice: with format set to Letter it came out as 3 pages, the same as on A4.",{"question":29,"answer":30},"Can I test the layout without using credits?","Yes. Add sandbox: true. Sandbox PDFs don't count against your credits, carry a watermark, and are limited to 10 a minute.",{"type":32,"children":33,"toc":875},"root",[34,59,66,119,131,144,155,185,191,196,198,347,359,388,394,406,414,427,456,469,475,517,568,573,587,593,628,639,652,658,663,684,690,698,741,748,775,782,794,801,822,829,842,849,862],{"type":35,"tag":36,"props":37,"children":38},"element","p",{},[39,42,49,51,57],{"type":40,"value":41},"text","Turning an HTML invoice into a PDF takes one POST to PDFShift. You don't run Chromium: we do. A long invoice needs one flag, ",{"type":35,"tag":43,"props":44,"children":46},"code",{"className":45},[],[47],{"type":40,"value":48},"use_print: true",{"type":40,"value":50},", and two lines of CSS to print right. The flag repeats the table's header row on every page, but on its own it still cut a row in half on our 40-line test invoice and pushed \"Total due\" onto page 3, away from its subtotal and tax. Two ",{"type":35,"tag":43,"props":52,"children":54},{"className":53},[],[55],{"type":40,"value":56},"break-inside: avoid",{"type":40,"value":58}," rules fix that. With both, a 150-line invoice came out as 8 clean pages.",{"type":35,"tag":60,"props":61,"children":63},"h2",{"id":62},"how-do-i-turn-an-html-invoice-into-a-pdf-with-an-api",[64],{"type":40,"value":65},"How do I turn an HTML invoice into a PDF with an API?",{"type":35,"tag":36,"props":67,"children":68},{},[69,71,77,79,85,87,93,95,101,103,109,111,117],{"type":40,"value":70},"Send the invoice as a full HTML document in ",{"type":35,"tag":43,"props":72,"children":74},{"className":73},[],[75],{"type":40,"value":76},"source",{"type":40,"value":78},", with your API key in the ",{"type":35,"tag":43,"props":80,"children":82},{"className":81},[],[83],{"type":40,"value":84},"X-API-Key",{"type":40,"value":86}," header. Four more fields make a long invoice print well: ",{"type":35,"tag":43,"props":88,"children":90},{"className":89},[],[91],{"type":40,"value":92},"format",{"type":40,"value":94}," for the paper size, ",{"type":35,"tag":43,"props":96,"children":98},{"className":97},[],[99],{"type":40,"value":100},"margin",{"type":40,"value":102}," for white space around the content, ",{"type":35,"tag":43,"props":104,"children":106},{"className":105},[],[107],{"type":40,"value":108},"use_print",{"type":40,"value":110}," to render with print styles, and ",{"type":35,"tag":43,"props":112,"children":114},{"className":113},[],[115],{"type":40,"value":116},"footer",{"type":40,"value":118}," for the page numbers. Here it is in Node.js 18 or later:",{"type":35,"tag":120,"props":121,"children":126},"pre",{"code":122,"language":123,"meta":7,"className":124},"import { readFile, writeFile } from \"node:fs/promises\";\n\nconst html = await readFile(\"invoice.html\", \"utf8\");\n\nconst res = await fetch(\"https://api.pdfshift.io/v3/convert/pdf\", {\n  method: \"POST\",\n  headers: {\n    \"X-API-Key\": process.env.PDFSHIFT_API_KEY,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    source: html,\n    format: \"A4\",\n    margin: \"40px 40px 20px 40px\",\n    use_print: true,\n    footer: {\n      source: '\u003Cdiv style=\"font-size:10px; width:100%; text-align:center; color:#555;\">Page {{page}} of {{total}}\u003C/div>',\n      height: \"40\",\n    },\n  }),\n});\n\nif (!res.ok) throw new Error(`PDFShift ${res.status}: ${await res.text()}`);\nawait writeFile(\"invoice.pdf\", Buffer.from(await res.arrayBuffer()));\n","javascript",[125],"language-javascript",[127],{"type":35,"tag":43,"props":128,"children":129},{"__ignoreMap":7},[130],{"type":40,"value":122},{"type":35,"tag":36,"props":132,"children":133},{},[134,136,142],{"type":40,"value":135},"And in Python with ",{"type":35,"tag":43,"props":137,"children":139},{"className":138},[],[140],{"type":40,"value":141},"requests",{"type":40,"value":143},":",{"type":35,"tag":120,"props":145,"children":150},{"code":146,"language":147,"meta":7,"className":148},"import os\nimport requests\n\nwith open(\"invoice.html\", encoding=\"utf-8\") as f:\n    html = f.read()\n\nres = requests.post(\n    \"https://api.pdfshift.io/v3/convert/pdf\",\n    headers={\"X-API-Key\": os.environ[\"PDFSHIFT_API_KEY\"]},\n    json={\n        \"source\": html,\n        \"format\": \"A4\",\n        \"margin\": \"40px 40px 20px 40px\",\n        \"use_print\": True,\n        \"footer\": {\n            \"source\": '\u003Cdiv style=\"font-size:10px; width:100%; text-align:center; color:#555;\">Page {{page}} of {{total}}\u003C/div>',\n            \"height\": \"40\",\n        },\n    },\n    timeout=120,\n)\nres.raise_for_status()\nwith open(\"invoice.pdf\", \"wb\") as f:\n    f.write(res.content)\n","python",[149],"language-python",[151],{"type":35,"tag":43,"props":152,"children":153},{"__ignoreMap":7},[154],{"type":40,"value":146},{"type":35,"tag":36,"props":156,"children":157},{},[158,160,166,168,174,176,183],{"type":40,"value":159},"The response body is the PDF itself. ",{"type":35,"tag":43,"props":161,"children":163},{"className":162},[],[164],{"type":40,"value":165},"invoice.html",{"type":40,"value":167}," is your template with the data already filled in (by Handlebars, Jinja2 or whatever your app uses), plus the two print rules from the CSS section below in its ",{"type":35,"tag":43,"props":169,"children":171},{"className":170},[],[172],{"type":40,"value":173},"\u003Cstyle>",{"type":40,"value":175}," block. Both snippets returned our 40-line invoice as a 3-page PDF. If your invoice is a React component, ",{"type":35,"tag":177,"props":178,"children":180},"a",{"href":179},"/guides/react-to-pdf/",[181],{"type":40,"value":182},"our React to PDF guide",{"type":40,"value":184}," shows how to turn it into HTML first.",{"type":35,"tag":60,"props":186,"children":188},{"id":187},"why-does-a-long-invoice-break-across-pdf-pages",[189],{"type":40,"value":190},"Why does a long invoice break across PDF pages?",{"type":35,"tag":36,"props":192,"children":193},{},[194],{"type":40,"value":195},"A browser lays out a page for the screen, then cuts it into sheets wherever the paper ends. A table row, a totals block or your payment terms can land on that cut. We built one invoice template and sent it to PDFShift with 40 and 150 line items, set up four ways. The set-ups with print CSS also had the margin and footer from the code above; the other two had neither. Here's what each one did to the 40-line invoice:",{"type":40,"value":197},"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",{"type":35,"tag":199,"props":200,"children":201},"table",{},[202,236],{"type":35,"tag":203,"props":204,"children":205},"thead",{},[206],{"type":35,"tag":207,"props":208,"children":209},"tr",{},[210,216,221,226,231],{"type":35,"tag":211,"props":212,"children":213},"th",{},[214],{"type":40,"value":215},"Set-up",{"type":35,"tag":211,"props":217,"children":218},{},[219],{"type":40,"value":220},"Row cut in half",{"type":35,"tag":211,"props":222,"children":223},{},[224],{"type":40,"value":225},"Header repeats",{"type":35,"tag":211,"props":227,"children":228},{},[229],{"type":40,"value":230},"Totals whole",{"type":35,"tag":211,"props":232,"children":233},{},[234],{"type":40,"value":235},"Pages, 40 / 150 lines",{"type":35,"tag":237,"props":238,"children":239},"tbody",{},[240,268,293,323],{"type":35,"tag":207,"props":241,"children":242},{},[243,249,254,259,263],{"type":35,"tag":244,"props":245,"children":246},"td",{},[247],{"type":40,"value":248},"No fixes",{"type":35,"tag":244,"props":250,"children":251},{},[252],{"type":40,"value":253},"Yes",{"type":35,"tag":244,"props":255,"children":256},{},[257],{"type":40,"value":258},"No",{"type":35,"tag":244,"props":260,"children":261},{},[262],{"type":40,"value":253},{"type":35,"tag":244,"props":264,"children":265},{},[266],{"type":40,"value":267},"3 / 7",{"type":35,"tag":207,"props":269,"children":270},{},[271,276,280,284,288],{"type":35,"tag":244,"props":272,"children":273},{},[274],{"type":40,"value":275},"Print CSS only",{"type":35,"tag":244,"props":277,"children":278},{},[279],{"type":40,"value":258},{"type":35,"tag":244,"props":281,"children":282},{},[283],{"type":40,"value":258},{"type":35,"tag":244,"props":285,"children":286},{},[287],{"type":40,"value":253},{"type":35,"tag":244,"props":289,"children":290},{},[291],{"type":40,"value":292},"3 / 8",{"type":35,"tag":207,"props":294,"children":295},{},[296,306,310,314,318],{"type":35,"tag":244,"props":297,"children":298},{},[299,304],{"type":35,"tag":43,"props":300,"children":302},{"className":301},[],[303],{"type":40,"value":108},{"type":40,"value":305}," only",{"type":35,"tag":244,"props":307,"children":308},{},[309],{"type":40,"value":253},{"type":35,"tag":244,"props":311,"children":312},{},[313],{"type":40,"value":253},{"type":35,"tag":244,"props":315,"children":316},{},[317],{"type":40,"value":258},{"type":35,"tag":244,"props":319,"children":320},{},[321],{"type":40,"value":322},"3 / not run",{"type":35,"tag":207,"props":324,"children":325},{},[326,331,335,339,343],{"type":35,"tag":244,"props":327,"children":328},{},[329],{"type":40,"value":330},"Both",{"type":35,"tag":244,"props":332,"children":333},{},[334],{"type":40,"value":258},{"type":35,"tag":244,"props":336,"children":337},{},[338],{"type":40,"value":253},{"type":35,"tag":244,"props":340,"children":341},{},[342],{"type":40,"value":253},{"type":35,"tag":244,"props":344,"children":345},{},[346],{"type":40,"value":292},{"type":35,"tag":36,"props":348,"children":349},{},[350,352,357],{"type":40,"value":351},"Neither fix works alone. Print CSS never repeated the header row. ",{"type":35,"tag":43,"props":353,"children":355},{"className":354},[],[356],{"type":40,"value":108},{"type":40,"value":358}," left subtotal and tax at the foot of page 2, so a customer who opens page 3 sees \"Total due\" with nothing above it.",{"type":35,"tag":360,"props":361,"children":363},"guide-figure",{"caption":362},"Page 3 of our 40-line invoice, with both fixes and with use_print only (no print CSS, no margin). Our test, December 1, 2026.",[364],{"type":35,"tag":365,"props":366,"children":368},"guide-page-pair",{":names":367},"[\"Both fixes\", \"use_print only\"]",[369,380],{"type":35,"tag":36,"props":370,"children":371},{},[372],{"type":35,"tag":373,"props":374,"children":379},"img",{"alt":375,"height":376,"src":377,"width":378},"Page 3 of the invoice with both fixes: the header row repeats at the top, lines 38 to 40 follow, then subtotal, tax and total due together, the payment terms, and Page 3 of 3 at the bottom.",1018,"/images/guides/invoice-pdf-from-html-fixed-page-3.webp",720,[],{"type":35,"tag":36,"props":381,"children":382},{},[383],{"type":35,"tag":373,"props":384,"children":387},{"alt":385,"height":376,"src":386,"width":378},"Page 3 of the invoice with use_print only: Total due and $7,920.00 sit alone at the top right, cut off from the subtotal and tax on page 2, with the payment terms under it and no margin.","/images/guides/invoice-pdf-from-html-use-print-only-page-3.webp",[],{"type":35,"tag":60,"props":389,"children":391},{"id":390},"which-css-rules-keep-invoice-rows-and-totals-together",[392],{"type":40,"value":393},"Which CSS rules keep invoice rows and totals together?",{"type":35,"tag":36,"props":395,"children":396},{},[397,399,404],{"type":40,"value":398},"Two rules, in the template's ",{"type":35,"tag":43,"props":400,"children":402},{"className":401},[],[403],{"type":40,"value":173},{"type":40,"value":405}," block:",{"type":35,"tag":120,"props":407,"children":409},{"code":408},"tr { break-inside: avoid; }\n.totals, .notes { break-inside: avoid; }\n",[410],{"type":35,"tag":43,"props":411,"children":412},{"__ignoreMap":7},[413],{"type":40,"value":408},{"type":35,"tag":36,"props":415,"children":416},{},[417,419,425],{"type":40,"value":418},"The first tells the browser never to put a page break inside a table row, so a line item moves to the next page whole. The second does the same for the totals block and the payment terms. Swap in whatever classes wrap those in your template. Older templates may use ",{"type":35,"tag":43,"props":420,"children":422},{"className":421},[],[423],{"type":40,"value":424},"page-break-inside: avoid",{"type":40,"value":426},", which is the legacy name for the same property.",{"type":35,"tag":36,"props":428,"children":429},{},[430,432,438,440,446,448,454],{"type":40,"value":431},"You can skip ",{"type":35,"tag":43,"props":433,"children":435},{"className":434},[],[436],{"type":40,"value":437},"thead { display: table-header-group; }",{"type":40,"value":439}," if your table has a real ",{"type":35,"tag":43,"props":441,"children":443},{"className":442},[],[444],{"type":40,"value":445},"\u003Cthead>",{"type":40,"value":447},": that's already how a browser treats it. We took the rule out and sent the 40- and 150-line invoices again, and the PDFs came back identical apart from their timestamps. It only matters when your header row is built from ",{"type":35,"tag":43,"props":449,"children":451},{"className":450},[],[452],{"type":40,"value":453},"\u003Cdiv>",{"type":40,"value":455},"s.",{"type":35,"tag":36,"props":457,"children":458},{},[459,461,467],{"type":40,"value":460},"Set the margin in the request, too. With none, our template printed its text right against the edge of the sheet. ",{"type":35,"tag":43,"props":462,"children":464},{"className":463},[],[465],{"type":40,"value":466},"\"40px 40px 20px 40px\"",{"type":40,"value":468}," gave us room on every side, in CSS order: top, right, bottom, left.",{"type":35,"tag":60,"props":470,"children":472},{"id":471},"how-do-i-add-page-1-of-3-to-every-invoice-page",[473],{"type":40,"value":474},"How do I add \"Page 1 of 3\" to every invoice page?",{"type":35,"tag":36,"props":476,"children":477},{},[478,480,485,487,492,494,500,502,508,510,515],{"type":40,"value":479},"Use the ",{"type":35,"tag":43,"props":481,"children":483},{"className":482},[],[484],{"type":40,"value":116},{"type":40,"value":486}," field. Its ",{"type":35,"tag":43,"props":488,"children":490},{"className":489},[],[491],{"type":40,"value":76},{"type":40,"value":493}," is a small piece of HTML, and two variables are filled in on each page: ",{"type":35,"tag":43,"props":495,"children":497},{"className":496},[],[498],{"type":40,"value":499},"{{page}}",{"type":40,"value":501}," for the current page and ",{"type":35,"tag":43,"props":503,"children":505},{"className":504},[],[506],{"type":40,"value":507},"{{total}}",{"type":40,"value":509}," for the page count. The footer doesn't get your page's CSS, so style it inline or with its own ",{"type":35,"tag":43,"props":511,"children":513},{"className":512},[],[514],{"type":40,"value":173},{"type":40,"value":516}," tag.",{"type":35,"tag":36,"props":518,"children":519},{},[520,526,528,534,536,542,544,550,552,558,560,566],{"type":35,"tag":43,"props":521,"children":523},{"className":522},[],[524],{"type":40,"value":525},"height",{"type":40,"value":527}," sets the space between the end of your content and the bottom of the sheet. With ",{"type":35,"tag":43,"props":529,"children":531},{"className":530},[],[532],{"type":40,"value":533},"\"height\": \"40\"",{"type":40,"value":535}," and our 20 px bottom margin, the numbers sat clear of the last table row on every page. To leave the footer off the first pages, set ",{"type":35,"tag":43,"props":537,"children":539},{"className":538},[],[540],{"type":40,"value":541},"start_at",{"type":40,"value":543}," to the page it should start on. A ",{"type":35,"tag":43,"props":545,"children":547},{"className":546},[],[548],{"type":40,"value":549},"header",{"type":40,"value":551}," works the same way, and either one can also show ",{"type":35,"tag":43,"props":553,"children":555},{"className":554},[],[556],{"type":40,"value":557},"{{date}}",{"type":40,"value":559}," and ",{"type":35,"tag":43,"props":561,"children":563},{"className":562},[],[564],{"type":40,"value":565},"{{title}}",{"type":40,"value":567},".",{"type":35,"tag":36,"props":569,"children":570},{},[571],{"type":40,"value":572},"On our 150-line invoice, the totals and payment terms stayed together on the last page, and the footer counted from \"Page 1 of 8\" to \"Page 8 of 8\".",{"type":35,"tag":360,"props":574,"children":576},{"caption":575},"All 8 pages of the 150-line invoice from PDFShift, with both fixes and the footer. Our test, December 1, 2026.",[577],{"type":35,"tag":36,"props":578,"children":579},{},[580],{"type":35,"tag":373,"props":581,"children":586},{"alt":582,"height":583,"src":584,"width":585},"The 150-line invoice as 8 A4 pages in two rows of four. Page 1 has the invoice header, the bill-to block and lines 1 to 16. Pages 2 to 8 each start with the dark header row. Page 8 ends with lines 143 to 150, subtotal $24,670.00, tax $4,934.00, total due $29,604.00 and the payment terms. Each page has Page N of 8 at the bottom.",1000,"/images/guides/invoice-pdf-from-html-150-items-8-pages.webp",1440,[],{"type":35,"tag":60,"props":588,"children":590},{"id":589},"how-do-i-put-the-invoice-number-on-every-page",[591],{"type":40,"value":592},"How do I put the invoice number on every page?",{"type":35,"tag":36,"props":594,"children":595},{},[596,598,604,606,611,613,618,620,626],{"type":40,"value":597},"Put it in the document's ",{"type":35,"tag":43,"props":599,"children":601},{"className":600},[],[602],{"type":40,"value":603},"\u003Ctitle>",{"type":40,"value":605}," and print ",{"type":35,"tag":43,"props":607,"children":609},{"className":608},[],[610],{"type":40,"value":565},{"type":40,"value":612}," in a ",{"type":35,"tag":43,"props":614,"children":616},{"className":615},[],[617],{"type":40,"value":549},{"type":40,"value":619},". Page 2 of a long invoice is just rows. A customer who prints it, or forwards one page to their accounts team, can lose track of which invoice it belongs to. Our template's title was ",{"type":35,"tag":43,"props":621,"children":623},{"className":622},[],[624],{"type":40,"value":625},"Invoice INV-2026-0142",{"type":40,"value":627},", and we added this next to the footer from the first code block:",{"type":35,"tag":120,"props":629,"children":634},{"code":630,"language":631,"meta":7,"className":632},"\"header\": {\n  \"source\": \"\u003Cdiv style=\\\"font-size:10px; width:100%; text-align:right; color:#555; padding-right:40px;\\\">{{title}}\u003C/div>\",\n  \"height\": \"40\"\n}\n","json",[633],"language-json",[635],{"type":35,"tag":43,"props":636,"children":637},{"__ignoreMap":7},[638],{"type":40,"value":630},{"type":35,"tag":36,"props":640,"children":641},{},[642,644,650],{"type":40,"value":643},"We raised the top margin to 60px (",{"type":35,"tag":43,"props":645,"children":647},{"className":646},[],[648],{"type":40,"value":649},"\"60px 40px 20px 40px\"",{"type":40,"value":651},") so the header had room above the table. Every page of the 40-line invoice then carried \"Invoice INV-2026-0142\" in its top right corner, still 3 pages and 1 credit. The title can carry anything your template fills in, like the customer's name or the due date.",{"type":35,"tag":60,"props":653,"children":655},{"id":654},"does-a-longer-invoice-take-longer-or-cost-more",[656],{"type":40,"value":657},"Does a longer invoice take longer or cost more?",{"type":35,"tag":36,"props":659,"children":660},{},[661],{"type":40,"value":662},"Not in our test. PDFShift took about 2.1 to 2.3 seconds per invoice whether it had 5, 40 or 150 lines. Every PDF cost 1 credit: we count 1 credit per 5 MB of output, and our invoices came out between 31 KB and 53 KB. On the $9 plan, 500 credits a month is 500 invoices like these, 5 lines or 150.",{"type":35,"tag":36,"props":664,"children":665},{},[666,668,674,676,682],{"type":40,"value":667},"A web font made the file bigger, but not the bill. We loaded Lora with a plain ",{"type":35,"tag":43,"props":669,"children":671},{"className":670},[],[672],{"type":40,"value":673},"\u003Clink>",{"type":40,"value":675}," tag and no wait setting: it was embedded in the PDF, and the 40-line invoice grew from 41 KB to 139 KB, still 1 credit. Prices for every plan are on the ",{"type":35,"tag":177,"props":677,"children":679},{"href":678},"/pdf-generator-api/",[680],{"type":40,"value":681},"PDF generator API",{"type":40,"value":683}," page.",{"type":35,"tag":60,"props":685,"children":687},{"id":686},"frequently-asked-questions",[688],{"type":40,"value":689},"Frequently asked questions",{"type":35,"tag":36,"props":691,"children":692},{},[693],{"type":35,"tag":694,"props":695,"children":696},"strong",{},[697],{"type":40,"value":14},{"type":35,"tag":36,"props":699,"children":700},{},[701,703,709,711,717,718,724,726,732,734,740],{"type":40,"value":702},"Yes. Add a ",{"type":35,"tag":43,"props":704,"children":706},{"className":705},[],[707],{"type":40,"value":708},"filename",{"type":40,"value":710}," of at least 7 characters (letters, digits, ",{"type":35,"tag":43,"props":712,"children":714},{"className":713},[],[715],{"type":40,"value":716},"-",{"type":40,"value":559},{"type":35,"tag":43,"props":719,"children":721},{"className":720},[],[722],{"type":40,"value":723},"_",{"type":40,"value":725},") and the response becomes JSON with a ",{"type":35,"tag":43,"props":727,"children":729},{"className":728},[],[730],{"type":40,"value":731},"url",{"type":40,"value":733}," to the PDF, kept for 2 days. To keep it longer, send it to your own S3 bucket with ",{"type":35,"tag":43,"props":735,"children":737},{"className":736},[],[738],{"type":40,"value":739},"s3_destination",{"type":40,"value":567},{"type":35,"tag":36,"props":742,"children":743},{},[744],{"type":35,"tag":694,"props":745,"children":746},{},[747],{"type":40,"value":17},{"type":35,"tag":36,"props":749,"children":750},{},[751,753,759,761,766,768,773],{"type":40,"value":752},"The response body is the PDF file itself, so attach those bytes to your email as ",{"type":35,"tag":43,"props":754,"children":756},{"className":755},[],[757],{"type":40,"value":758},"invoice.pdf",{"type":40,"value":760}," with your usual mail library or email API. If you'd rather send a link, add a ",{"type":35,"tag":43,"props":762,"children":764},{"className":763},[],[765],{"type":40,"value":708},{"type":40,"value":767}," and email the ",{"type":35,"tag":43,"props":769,"children":771},{"className":770},[],[772],{"type":40,"value":731},{"type":40,"value":774}," that comes back.",{"type":35,"tag":36,"props":776,"children":777},{},[778],{"type":35,"tag":694,"props":779,"children":780},{},[781],{"type":40,"value":20},{"type":35,"tag":36,"props":783,"children":784},{},[785,787,792],{"type":40,"value":786},"Yes. Put the address in ",{"type":35,"tag":43,"props":788,"children":790},{"className":789},[],[791],{"type":40,"value":76},{"type":40,"value":793}," and PDFShift loads the page and converts it, with the same parameters.",{"type":35,"tag":36,"props":795,"children":796},{},[797],{"type":35,"tag":694,"props":798,"children":799},{},[800],{"type":40,"value":23},{"type":35,"tag":36,"props":802,"children":803},{},[804,806,812,814,820],{"type":40,"value":805},"Yes. Send one request per invoice with a ",{"type":35,"tag":43,"props":807,"children":809},{"className":808},[],[810],{"type":40,"value":811},"webhook",{"type":40,"value":813}," URL. Each call is queued at once and PDFShift posts a link to each finished PDF to your server. Our ",{"type":35,"tag":177,"props":815,"children":817},{"href":816},"/guides/batch-pdf-generation-webhooks/",[818],{"type":40,"value":819},"batch PDF guide",{"type":40,"value":821}," has the sender and receiver code.",{"type":35,"tag":36,"props":823,"children":824},{},[825],{"type":35,"tag":694,"props":826,"children":827},{},[828],{"type":40,"value":26},{"type":35,"tag":36,"props":830,"children":831},{},[832,834,840],{"type":40,"value":833},"Not for our 40-line invoice: with ",{"type":35,"tag":43,"props":835,"children":837},{"className":836},[],[838],{"type":40,"value":839},"\"format\": \"Letter\"",{"type":40,"value":841}," it came out as 3 pages, the same as on A4.",{"type":35,"tag":36,"props":843,"children":844},{},[845],{"type":35,"tag":694,"props":846,"children":847},{},[848],{"type":40,"value":29},{"type":35,"tag":36,"props":850,"children":851},{},[852,854,860],{"type":40,"value":853},"Yes. Add ",{"type":35,"tag":43,"props":855,"children":857},{"className":856},[],[858],{"type":40,"value":859},"\"sandbox\": true",{"type":40,"value":861},". Sandbox PDFs don't count against your credits, carry a watermark, and are limited to 10 a minute.",{"type":35,"tag":36,"props":863,"children":864},{},[865,867,873],{"type":40,"value":866},"To try it on your own template, ",{"type":35,"tag":177,"props":868,"children":870},{"href":869},"/register/",[871],{"type":40,"value":872},"create a free account",{"type":40,"value":874},": you get 50 credits a month, no card needed.",{"title":7,"searchDepth":876,"depth":876,"links":877},2,[878,879,880,881,882,883,884],{"id":62,"depth":876,"text":65},{"id":187,"depth":876,"text":190},{"id":390,"depth":876,"text":393},{"id":471,"depth":876,"text":474},{"id":589,"depth":876,"text":592},{"id":654,"depth":876,"text":657},{"id":686,"depth":876,"text":689},"markdown","content:guides:invoice-pdf-from-html.md","content","guides/invoice-pdf-from-html.md","md",1796486664532]