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.
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
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.

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" /> 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!
Continue reading on similar topics
Creating professional HTML invoices that convert perfectly to PDF is essential for any business. 5 beautiful invoice templates with live PDF generators.
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.
Create professional HTML receipt templates that convert perfectly to PDF. Use our free receipt PDF generator or choose from 5 customizable templates for e-commerce, SaaS, and service businesses.
Learn how to generate QR codes in PDF documents using JavaScript. Complete guide with examples for invoices, tickets, certificates, and business cards.
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.
Learn how to automate PDF generation in n8n workflows. Complete guide covering HTML to PDF conversion, invoice generation, and workflow templates.
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.
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.
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 |
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.
Continue reading on similar topics
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.
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.
Create professional HTML receipt templates that convert perfectly to PDF. Use our free receipt PDF generator or choose from 5 customizable templates for e-commerce, SaaS, and service businesses.
Master async JavaScript execution in PDF generation. Learn the window.__RENDER_DONE__ pattern for reliable HTML to PDF conversion with QR codes, charts, and dynamic content.
Learn how to generate QR codes in PDF documents using JavaScript. Complete guide with examples for invoices, tickets, certificates, and business cards.
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.
Learn how to automate PDF generation in n8n workflows. Complete guide covering HTML to PDF conversion, invoice generation, and workflow templates.
Adding page numbers and footers to PDF documents. Explore 6 different approaches with interactive examples.<br>
Creating professional HTML invoices that convert perfectly to PDF is essential for any business. 5 beautiful invoice templates with live PDF generators.
Broken page breaks, margins, fonts, tables? Fix the most common HTML-to-PDF issues with practical CSS strategies and examples.
Master print styles with our Print CSS Cheatsheet. Learn tips, tricks, and code examples to create professional, print-ready HTML documents.
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.
Cost-effective alternative to QuickBooks & FreshBooks. Automatic PDF invoice generation with n8n, Make.com, or API integration.