{"id":315,"date":"2026-10-15T21:33:09","date_gmt":"2026-10-15T21:33:09","guid":{"rendered":"https:\/\/blog.skndan.com\/jsontoimg\/2026\/10\/15\/pdf-generation-api-per-page-billing\/"},"modified":"2026-11-17T13:33:11","modified_gmt":"2026-11-17T13:33:11","slug":"pdf-generation-api-per-page-billing","status":"publish","type":"post","link":"https:\/\/blog.skndan.com\/jsontoimg\/2026\/10\/15\/pdf-generation-api-per-page-billing\/","title":{"rendered":"Multi-Page PDF Generation API: Templates and Per-Page Credits"},"content":{"rendered":"<p>A PDF generation API usually means one of two things: converting HTML, Markdown, or a URL to PDF, or filling a designed template and exporting it. jsontoimg is the second kind. Set <code>format<\/code> to <code>pdf<\/code> on the same render call you use for images, and a multi-page template becomes a multi-page PDF.<\/p>\n<h2>The request<\/h2>\n<pre><code>curl -X POST &quot;$JSONTOIMG_BASE_URL\/api\/v1\/render?wait=60&quot; \\\n  -H &quot;Authorization: Bearer $JSONTOIMG_API_KEY&quot; \\\n  -H &quot;Content-Type: application\/json&quot; \\\n  -d &#39;{&quot;template&quot;:&quot;&lt;design-id&gt;&quot;,&quot;format&quot;:&quot;pdf&quot;,&quot;layers&quot;:{&quot;full_name&quot;:{&quot;text&quot;:&quot;Ada Lovelace&quot;}}}&#39;\n<\/code><\/pre>\n<p>Layer overrides work exactly as they do for images, and so do <code>wait<\/code>, batch, and webhooks. A misspelled layer name returns <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Reference\/Status\/422\">422 Unprocessable Content<\/a> instead of a PDF with placeholder text.<\/p>\n<h2>What a PDF costs<\/h2>\n<p>One credit per page.<\/p>\n<table>\n<thead>\n<tr>\n<th>Output<\/th>\n<th>Credits<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1-page certificate<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>5-page proposal<\/td>\n<td>5<\/td>\n<\/tr>\n<tr>\n<td>12-page report<\/td>\n<td>12<\/td>\n<\/tr>\n<tr>\n<td>One PNG of the same design<\/td>\n<td>1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Failed jobs are free, and a quota overrun returns <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Reference\/Status\/402\">402 Payment Required<\/a>. At the prepaid rate of $0.02 per image, a 12-page report costs $0.24. Design to the page count you need: a template with a spare page costs a credit on every render.<\/p>\n<h2>Rules to know<\/h2>\n<ul>\n<li><code>transparent<\/code> is not valid with PDF. It works with PNG, WebP, and AVIF only.<\/li>\n<li><code>wait<\/code> blocks for at most 60 seconds. Longer jobs return a job id; use a webhook or poll.<\/li>\n<li>A batch accepts up to 50 jobs, and each job sets its own <code>format<\/code>.<\/li>\n<li>Layout comes from the editor. Content that must reflow, such as a table that grows to a second page by itself, belongs in a template where you chose the page count.<\/li>\n<\/ul>\n<h2>What it does not do<\/h2>\n<p>jsontoimg does not turn arbitrary HTML, Markdown, or a live URL into a PDF. Tools such as <a href=\"https:\/\/jsontoimg.com\/alternatives\/apitemplate\">APITemplate.io<\/a> are built around HTML-to-PDF. If your source is a web page, use a tool that renders web pages. If your source is a design with named fields, this is the shorter path.<\/p>\n<h2>Pairing PDF with PNG<\/h2>\n<p>Many certificate and ticket flows render both: a PNG for the email body and a PDF for printing, from the same template and payload. That is two credits per recipient. The pipeline is in the <a href=\"https:\/\/jsontoimg.com\/blog\/certificate-generator-api-guide\">bulk certificate generation from a CSV<\/a>, and the format reference is in the <a href=\"https:\/\/jsontoimg.com\/docs\/generate\/pdf\">PDF docs<\/a>. The <a href=\"https:\/\/en.wikipedia.org\/wiki\/PDF\">PDF format overview<\/a> covers what the file type guarantees.<\/p>\n<h2>FAQ<\/h2>\n<h3>How does jsontoimg generate PDFs?<\/h3>\n<p>Send POST \/api\/v1\/render with format set to pdf. A multi-page template becomes a multi-page PDF, and layer overrides work as they do for images.<\/p>\n<h3>How are PDFs billed?<\/h3>\n<p>One credit per page. A 12-page report uses 12 credits, a failed job uses none, and prepaid packs work out to $0.02 per image.<\/p>\n<h3>Can I convert HTML or a URL to PDF with jsontoimg?<\/h3>\n<p>No. jsontoimg renders designs from its editor with named layers. For arbitrary HTML, Markdown, or URL conversion, use a tool built for that.<\/p>\n<h3>Can I make a transparent PDF?<\/h3>\n<p>No. The transparent option is not valid with PDF and works only with PNG, WebP, and AVIF.<\/p>\n<h2>Related Resources<\/h2>\n<ul>\n<li><a href=\"https:\/\/jsontoimg.com\/product\/pdf-generation-api\">PDF generation API<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/tools\/free-invoice-generator\">Free invoice generator<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/use-cases\/certificates\">Certificate generator API<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/pricing\">jsontoimg pricing<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/json-to-image-converter\">How JSON-to-image conversion works<\/a> \u2014 the pillar guide<\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/certificate-generator-api-guide\">bulk certificate generation from a CSV<\/a> \u2014 PDF in a real pipeline<\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/docs\/generate\/pdf\">PDF renders docs<\/a> \u2014 format reference<\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/alternatives\/apitemplate\">APITemplate.io alternative<\/a> \u2014 HTML-to-PDF comparison<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>How the jsontoimg PDF generation API works: format pdf on the render call, multi-page templates, one credit per page, and what it deliberately does not convert.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-315","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/posts\/315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/comments?post=315"}],"version-history":[{"count":1,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/posts\/315\/revisions"}],"predecessor-version":[{"id":354,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/posts\/315\/revisions\/354"}],"wp:attachment":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/media?parent=315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/categories?post=315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/tags?post=315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}