The PDF API that saves you time & money

Want to learn more about the API? The interactive playground on this page uses our Native API. Check out the API Documentation for more details.

Generate up to 600 free documents every month with our PDF API. Convert HTML to PDF, PDF to PNG, or merge PDF workflows with ease using simple JavaScript. CustomJS is more affordable than most other PDF APIs and works seamlessly anywhere, including Make.com and n8n.

✅ 600 Free Documents Every Month

💸 Cheaper Than Other PDF APIs

🛠️ No New Servers Needed


Start free with 600 PDFs per month

Or use our standalone PDF API anywhere

A PDF API allows you to create, edit, merge, and convert PDF files automatically—no manual steps required. But most APIs are slow, costly, or overly complex. CustomJS changes that with fast, serverless PDF generation powered by simple JavaScript. Convert HTML to PDF efficiently—saving both time and money.


  • Lower Cost: Save money every month with simple, honest pricing.
  • Faster Speed: Get your output PDF files instantly without waiting.
  • More Flexibility: Build exactly what you want with serverless JavaScript anywhere.

CustomJS HTML 2 PDF
CustomJS HTML 2 PDF

Advanced PDF Features

📦 Using External JavaScript Libraries (QR Codes)

You can use external JavaScript libraries like QRCode.js in your PDF templates. When using ES Modules, wrap your import in a module script tag:

<script type="module">
  import QRCode from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm';

  // Generate QR code
  const qrDataUrl = await QRCode.toDataURL('https://example.com', {
    width: 150,
    margin: 1
  });

  // Set the image source
  document.getElementById('qr').src = qrDataUrl;
</script>

<img id="qr" alt="QR Code" />

→ Read the complete QR Code guide

⏱️ Async Rendering with window.__RENDER_DONE__

When using asynchronous JavaScript (QR codes, charts, API calls), you must signal when your content is ready by setting window.__RENDER_DONE__ = true. The PDF generator waits for this flag before capturing the page.

<script type="module">
  import QRCode from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm';

  // Initialize as false
  window.__RENDER_DONE__ = false;

  async function generateQR() {
    // Your async operations
    const qrDataUrl = await QRCode.toDataURL('https://example.com');
    document.getElementById('qr').src = qrDataUrl;

    // Signal that rendering is complete
    window.__RENDER_DONE__ = true;
  }

  // Start generation
  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', generateQR);
  } else {
    generateQR();
  }
</script>

⚠️ Important: Without setting window.__RENDER_DONE__ = true, your PDF may be blank or incomplete because the generator won't wait for async operations to finish!

Related Articles

Continue reading on similar topics

HTML Invoice Generator  (+Free Templates)
·Guide

HTML Invoice Generator (+Free Templates)

Creating professional HTML invoices that convert perfectly to PDF is essential for any business. 5 beautiful invoice templates with live PDF generators.

pdfhtml-to-pdfinvoice
PDF Generation in Power Automate: Complete Guide 2025
·Guide

PDF Generation in Power Automate: Complete Guide 2025

Generate professional PDFs in Power Automate with CustomJS. Create invoices, receipts, reports, and certificates with custom HTML templates, QR codes, and advanced formatting. No Azure Functions required.

power-automatepdfhtml-to-pdf
Make.com PDF Generation: Complete Guide 2025
·Guide

Make.com PDF Generation: Complete Guide 2025

Learn how to automate PDF generation in Make.com with CustomJS. Step-by-step guide with templates for invoices, HTML to PDF, and page extraction. 600 free PDFs/month.

makepdfautomation

Use other examples to quickly create and work with PDFs

Quickly create, merge, compress, and convert files with our ready-to-use PDF API endpoints. Build your own PDF generation API that fits your needs.

  • PDF to PNG – Turn PDF pages into png images. View preset
  • PDF to Text – Extract texts from PDF. View preset
  • Merge PDFs – Combine invoices, reports, attachments. View preset
  • Extract Pages from PDF – Pull selected pages into new PDF. View preset
  • Compress a PDF – Shrink file size by 70% easily. View preset
  • Take a Website Screenshot – Capture websites into clear PNGs. View preset

Build your own custom API with our pdfUtils

Customize your PDF generation API Using JavaScript

Need full control over your PDF generator API? Our pdfUtils allows you to create customizable documents for HTML-to-PDF conversions, compress PDF files, merge PDF JavaScript, or extract pages. No servers. No advanced tools. Just your code, your rules.

const { PDF_MERGE, HTML2PDF } = require('./utils');

let pages = [
    input.page1,
    input.page2,
    input.page3,
    input.page4,
    input.page5,
    input.page6,
    input.page7,
    input.page8,
    input.page9,
    input.page10,
    input.page11
];

pages = await Promise.all(pages.filter(i => i).map(i => HTML2PDF(i)));

return PDF_MERGE(pages);

This example shows how you can pass an array of HTML pages, generate a PDF for each one, and then merge them into a single file.


curl -X POST https://e.customjs.io/zeXXXy \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY_HERE" \
  -d '{
    "page1": "<html>...</html>",
    "page2": "<html>...</html>",
    "page3": "<html>...</html>",
    "page4": "<html>...</html>",
    "page5": "<html>...</html>",
    "page6": "<html>...</html>",
    "page7": "<html>...</html>",
    "page8": "<html>...</html>",
    "page9": "<html>...</html>",
    "page10": "<html>...</html>",
    "page11": "<html>...</html>"
  }' > test.pdf

This is how you would call your custom api.

Affordable HTML-to-PDF Conversion

CustomJS gives you 600 PDF/API calls every month for free, then scales from just $9 for 3,000+ calls, beating the "PDF-as-a-Service" incumbents on both cost and flexibility.

Feature CustomJS ConvertAPI DocRaptor Api2PDF
Free Tier 600 req/mo, no credit card 250 trial conv. None None
Starter Plan $9/mo $30/mo $15/mo $1 base + usage
Billing Type Per document (no setup) Per conv. Quota + usage Time + file size
Integrations Make.com, n8n, Zapier REST API PrinceXML wkhtmltopdf, ChromeHead

FAQs

What is a PDF API, and how does CustomJS help?
A PDF API lets you create, edit, and manage PDF files automatically with simple API calls. CustomJS offers a powerful API and an affordable option to build HTML-to-PDF workflows, merge PDF files, compress documents, and support a wide range of PDF actions, without expensive setup or server costs.

Can I use CustomJS to convert HTML to PDF?
Yes. Our HTML to PDF API makes it easy to convert dynamic HTML or CSS into pixel-perfect PDFs. You can build PDF creation flows within Make.com or n8n using our dynamic PDF generator.

How much does it cost to use CustomJS’s PDF API?
You can generate up to 600 PDF documents per month for free. After that, our starter plan is only $9 per month.

Can I merge multiple PDF files using CustomJS?
Yes, you can use our merge PDF API to combine invoices, reports, or multiple PDF documents into a single file quickly.

Does CustomJS allow me to compress PDF files?
Absolutely. Our compress PDF JS functionality lets you shrink PDF file size by up to 70% without losing quality.

Can I extract pages from a PDF with JavaScript using CustomJS? Yes, you can use JavaScript to extract pages and create new files without extra tools.

Can I convert PDFs to images using CustomJS?
Yes. With CustomJS, you can easily convert PDF to PNG in your workflows.

Is CustomJS easy to integrate with Make.com and n8n?
Yes, you don't need any new server setup—just call our REST API.

Related Articles

Continue reading on similar topics

HTML Table to PDF: Complete Guide with Responsive Examples
·Guide

HTML Table to PDF: Complete Guide with Responsive Examples

Master HTML table to PDF conversion with landscape orientation, page breaks, and responsive patterns. Complete guide with examples for financial reports, data exports, and invoices. 600 free conversions/month.

pdfhtml-to-pdftable
PDF Generation in Power Automate: Complete Guide 2025
·Guide

PDF Generation in Power Automate: Complete Guide 2025

Generate professional PDFs in Power Automate with CustomJS. Create invoices, receipts, reports, and certificates with custom HTML templates, QR codes, and advanced formatting. No Azure Functions required.

power-automatepdfhtml-to-pdf
Make.com PDF Generation: Complete Guide 2025
·Guide

Make.com PDF Generation: Complete Guide 2025

Learn how to automate PDF generation in Make.com with CustomJS. Step-by-step guide with templates for invoices, HTML to PDF, and page extraction. 600 free PDFs/month.

makepdfautomation
HTML Print Pagination & Footer
·Guide

HTML Print Pagination & Footer

Adding page numbers and footers to PDF documents. Explore 6 different approaches with interactive examples.<br>

pdfhtml-to-pdfpagination
HTML Invoice Generator  (+Free Templates)
·Guide

HTML Invoice Generator (+Free Templates)

Creating professional HTML invoices that convert perfectly to PDF is essential for any business. 5 beautiful invoice templates with live PDF generators.

pdfhtml-to-pdfinvoice
Common Issues in HTML-to-PDF Printing
·Guide

Common Issues in HTML-to-PDF Printing

Broken page breaks, margins, fonts, tables? Fix the most common HTML-to-PDF issues with practical CSS strategies and examples.

pdfhtml-to-pdftroubleshooting
HTML & CSS Tips for Better PDFs
·Guide

HTML & CSS Tips for Better PDFs

Master print styles with our Print CSS Cheatsheet. Learn tips, tricks, and code examples to create professional, print-ready HTML documents.

pdfhtml-to-pdfcss
Markdown to PDF: Complete Guide with Examples
·Guide

Markdown to PDF: Complete Guide with Examples

Convert Markdown to PDF with tables, code blocks, and custom styling. Complete guide with examples for API documentation, reports, and automated workflows. 600 free conversions/month.

markdownpdfmarkdown-to-pdf
Airtable Accounting for Freelancers
·Guide

Airtable Accounting for Freelancers

Cost-effective alternative to QuickBooks & FreshBooks. Automatic PDF invoice generation with n8n, Make.com, or API integration.

airtableinvoiceaccounting