Skip to content

ServiceNow PDF Generation API: PDF Generator API Options for Charts, Brand Templates and What They Cost

ServiceNow's built in PDFGenerationAPI is free and attaches the PDF to the record, but its engine does not run JavaScript, so chart heavy reports come out blank. For an MSP sending 400 service reviews a month, rendering just those documents through an external API costs $174 a year while the built in generator keeps the rest.

Live demo

Runs in your browser. Nothing is uploaded. One PDF free to try, then a plan.

Your PDF is downloading. That was the free one. The Starter plan converts as many as you need, for $29 a month or $174 a year.

See the plan

ServiceNow's PDF Generation API (sn_pdfgeneratorutils.PDFGenerationAPI) is free, active by default and good enough for most record printouts: it converts an HTML string to a PDF, attaches it to the record and can add a header image, footer text and page numbers. It stops being enough when the document depends on JavaScript (charts drawn by Chart.js or Highcharts), on a brand stylesheet built for a browser, or on paged media rules that have changed between releases. For those documents, the practical fix is to send the HTML to an external render API from a script and save the returned PDF as an attachment, which costs $29 a month for up to 10,000 documents on SitePDF. Everything below was checked against ServiceNow's Zurich API reference on 26 September 2026.

The team we are pricing

A US managed service provider runs its customer service desk on ServiceNow. Every month it sends each of its 400 clients a service review: ticket volumes, SLA attainment, a trend chart for the last twelve months and a page of open risks. It also sends about 2,500 ticket closure summaries to client contacts. The service review is the document sales brings to renewal meetings, so it has to look like the rest of the brand, charts included.

Say the platform team builds the first version on PDFGenerationAPI. The closure summaries come out fine. The service reviews come out with empty boxes where the charts should be, and the account managers go back to exporting dashboards by hand. The question for the platform owner was whether to keep fighting the built in generator, build a render service, or buy one, and what each would cost.

What the ServiceNow PDF Generation API does well

The API ships in the PDF Generation Utilities plugin (com.snc.apppdfgenerator), which ServiceNow's reference says is activated by default. The core method is convertToPDF(html, targetTable, targetTableSysId, pdfName, fontFamilySysId, documentConfiguration), and on success it returns the attachment_id of "the converted and attached PDF," listed in the Attachments table. So the file lands on the record with no extra code, which is the right behavior for almost every ServiceNow use case.

convertToPDFWithHeaderFooter adds a headerFooterInfo map: header and footer images by attachment sys_id, FooterText, GeneratePageNumber, margins, orientation and a PageSize of A4, LETTER or LEDGER. The documentConfiguration object takes accessibilityEnabled, a table of contents and page number settings, and both methods have async versions that return a request id. Fonts come from the PDF Generation Font Family table, and the reference caps output at 50 MB. The same class fills and flattens PDF form fields, merges signatures and redacts.

For a closure summary, an HR letter, a change record printout or anything built from plain HTML tables and text, that is a complete toolkit, and it costs nothing beyond the platform you already pay for. If your documents look right today, keep it.

Where the built in generator runs out

ServiceNow does not document its rendering engine on the API page. Community articles from the plugin's release describe it as built on iText 7, and a 2018 FAQ from a ServiceNow employee says the older HR generator used iText 5.5.2. That matters because of one sentence in iText's own documentation: "pdfHTML does not evaluate JavaScript." An HTML to PDF engine that does not run JavaScript cannot draw a chart that JavaScript draws. The canvas stays empty, which is exactly what the MSP sees.

Three other limits come up repeatedly in the ServiceNow community:

  • Paged media changed between releases. A reported San Diego upgrade stopped honoring @page rules that worked in Rome; the workaround was a system property that pins the older HTML to PDF version, and it was reported fixed in Tokyo. A document that depends on print CSS is a document to retest at every upgrade.
  • Images need a reachable address. Community reports say public absolute URLs work in the body and authenticated attachment URLs do not, so a logo stored as an attachment has to be embedded another way.
  • Browser stylesheets do not carry over cleanly. The version of the engine inside your instance is not published, so whether flexbox, grid or a particular web font renders is something you find out by testing, not by reading.

None of these are bugs to report. They are the normal trade of a server side HTML converter that does not run a browser. The service review hits the first limit hard; the closure summaries hit none of them.

Three ways to get the service reviews right, priced

OptionWhat it costsWhat you own afterwards
Keep PDFGenerationAPI, pre-render charts as images$0 in licenses; a few days of development to generate each chart as a PNG and embed itA chart image pipeline, plus every CSS difference between the browser view and the PDF
Run your own headless Chrome serviceA server or container plus the engineering time to patch Chrome, queue jobs and handle timeoutsA browser fleet, its security updates and its on call
Call an external render API from a script$29 a month, or $174 billed yearly, for up to 10,000 documents on SitePDF Starter APIAbout 20 lines of server script and an API key in a system property

The first option is the honest cheap answer and deserves a real look: if only one chart per document is the problem, rendering it as an image and letting PDFGenerationAPI handle the rest keeps everything inside the platform. It gets expensive when the document has several charts, conditional sections and a stylesheet the marketing team keeps changing, because every change now has to be made twice.

For this MSP, 400 service reviews plus 2,500 closure summaries is 2,900 documents a month, comfortably inside the Starter API tier. The sensible split is to route only the service reviews through the render API and keep the closure summaries on PDFGenerationAPI: 400 renders a month for $174 a year, with charts, the brand stylesheet and a footer with page numbers, while the built in generator keeps doing the job it does well. Every render also keeps a dated archive copy for 90 days, which is what you want in hand when a client disputes an SLA figure from two months earlier. Our PDF generator API page lists every render option.

Calling an external PDF generator API from ServiceNow

The mechanics are standard ServiceNow. Build the HTML in a script include (the same HTML you would have handed to convertToPDF, with its chart scripts left in), POST it to the render endpoint with sn_ws.RESTMessageV2, then fetch the PDF with a second request and call saveResponseBodyAsAttachment(tableName, recordSysId, fileName), which ServiceNow documents as saving "the returned response body as an attachment record." The method returns nothing, so query sys_attachment afterwards if you need the new sys_id.

var key = gs.getProperty('x_msp.sitepdf_api_key');

var render = new sn_ws.RESTMessageV2();
render.setEndpoint('https://api.sitepdf.com/v1/render');
render.setHttpMethod('POST');
render.setRequestHeader('Authorization', 'Bearer ' + key);
render.setRequestHeader('Content-Type', 'application/json');
render.setRequestBody(JSON.stringify({
    html: html,                       // charts and scripts left in
    format: 'Letter',
    wait_for: '#sla-chart canvas',    // wait until the chart exists
    footer_html: 'Page <span class="pageNumber"></span> of <span class="totalPages"></span>',
    archive: true
}));
var pdfUrl = JSON.parse(render.execute().getBody()).pdf_url;

var fetch = new sn_ws.RESTMessageV2();
fetch.setEndpoint(pdfUrl);
fetch.setHttpMethod('GET');
fetch.setRequestHeader('Authorization', 'Bearer ' + key);
fetch.saveResponseBodyAsAttachment('sn_customerservice_case', caseSysId, 'Service review September 2026.pdf');
fetch.execute();

Two notes for the platform owner. First, the Flow Designer REST step is not in the base system: ServiceNow's documentation says it "requires the ServiceNow Integration Hub subscription," so a scripted call is the route that works on any instance. Second, whether a scripted outbound call counts toward Integration Hub transactions is not stated on ServiceNow's API pages, and community answers disagree, so check your own contract before you schedule thousands of calls. At 400 a month it rarely matters; at 50,000 it might.

A scheduled job that builds the reports on the first of the month and a small queue for retries is all the rest of it needs. If the service desk is also struggling with the tickets behind those reports, a tool that routes every ticket to the right person fixes the numbers before they reach the PDF.

How to decide in an afternoon

  1. Take the three documents your users complain about most and run them through convertToPDF on a sub production instance. If they look right, you are done and the cost is zero.
  2. If they break, note why: JavaScript, print CSS, fonts or images. One chart and nothing else points to the image route.
  3. For anything else, paste the same HTML into the converter at the top of this page. If the output matches what users see in the browser, wire up the script above for those document types only.

Teams that generate documents from Salesforce as well as ServiceNow face the same choice with a different price list; we priced the CRM side in Conga Composer pricing. For a broader view of template driven generation, the document generation API comparison covers the vendors that merge data into templates rather than render HTML.

Written by the team behind SitePDF, an HTML to PDF API that archives every page it renders. The in-browser converter is free to try, and API plans start at $29 a month.

Get started

Render and archive with one API call

A pixel perfect PDF and a dated copy of the page from the same request. Plans from $29 a month.

HTML to PDF, in your browser

Buy the plan