# AIIPWorld as an html2pdf.js alternative

> A short, sourced comparison of the browser-side libraries html2pdf.js, html2canvas and jsPDF with AIIPWorld's server-side PDF API, which prints HTML with headless Chromium.

A short, factual comparison for people who use html2pdf.js, html2canvas or jsPDF in the browser and run into page breaks, blurry text or layout differences. Everything we say about those libraries comes from their own repositories, with the address and the date we checked next to each fact.

## Key facts

- Library facts come only from the three GitHub repositories, checked 2026-10-11; nothing else about them is claimed.
- The html2pdf.js README says it renders content into an image and places it in a PDF, so text is not selectable, and that it will not run in Node.js.
- AIIPWorld takes HTML or a public URL and returns a PDF from headless Chromium; a simple render costs 1 credit and the free plan has 100 credits a month.
- The libraries run in the visitor's browser and cost nothing per document; this page says when they suit you better, and does not rank output quality or speed.

## html2pdf.js, html2canvas and jsPDF: what each one does

This part is for people who are searching for an html2pdf alternative, an alternative to html2canvas, or a jsPDF alternative. The three libraries work together. html2pdf.js is the top layer. According to its README it converts a web page or element into a PDF entirely on the client, and it does that with html2canvas and jsPDF.

html2canvas reads the page's DOM and styles and draws them onto a canvas. Its README says it does not take a real screenshot but builds one from the information on the page. jsPDF is the library that writes the PDF file. Its html() method depends on html2canvas, which it loads when needed. People who search for jsPDF HTML are usually looking at that method.

All three run in the visitor's browser, so your server does nothing and the HTML never leaves the page. That is their main strength. Each fact below comes from the project's own repository, checked on 2026-10-11.

## Why the PDF can differ from the page

Because html2canvas draws its own picture of the page, the result can differ from what the browser shows. Its README lists CSS properties that are not supported yet and calls the library very experimental. The html2pdf.js README says html2canvas is not perfect, that html2pdf.js resizes the root element to fit the PDF page, and that the output is an image, so text is not selectable or searchable and files can be large.

Headless Chromium works differently. The server prints the page with the browser's own print function, so the CSS engine is the same one that draws the page, and text in the PDF stays text. A PDF made from our HTML to PDF tool, for example, can be searched and copied. This is the main reason people look for a server-side html2pdf alternative.

Page breaks are another reason. The html2pdf.js README says it respects most CSS break-before, break-after and break-inside rules, so check that on your own pages. In Chromium the same rules are part of printing, as the print CSS guide on this site shows.

## When html2pdf.js is the better choice

html2pdf.js may suit you better in several cases. You may want the download to happen in the visitor's browser with no server, no API key and no cost per document. Your content may be short and simple, such as a ticket or a small receipt. Or the HTML may be private enough that you do not want to send it anywhere. All three libraries are listed under the MIT licence in their repositories.

## When a server-side PDF makes sense

A server-side PDF makes sense when the document is made by your backend and not by a visitor, for example a nightly report or an invoice sent by email. The html2pdf.js README says it will not run in Node.js, and the html2canvas README says it is not suitable for Node.js, so a job on your server needs another tool.

It also helps when you need the same fonts on every document, headers and footers with page numbers, or a page size you set exactly. Our render server has the Noto fonts, including CJK and emoji, and Liberation 2. The jsPDF README notes that its 14 standard fonts cover only ASCII and that other characters need an embedded font file.

## Moving from html2pdf.js to the AIIPWorld API

The API takes a string of HTML, not a DOM element. Build the HTML on your server, or read the outerHTML of the element you used to pass to html2pdf.js, and send it with output set to pdf. Keep the API key on your server, because a key in browser code can be read by every visitor. A download button in your page should therefore call your own backend, which calls the API.

```bash
curl -X POST https://api.aiipworld.com/v1/render \
  -H "Authorization: Bearer $AIIPWORLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"html":"<h1>Invoice 1042</h1><p>Total due: $480.00</p>","output":"pdf","options":{"format":"A4","margin":{"top":"15mm","bottom":"15mm","left":"15mm","right":"15mm"},"print_background":true}}'

# returns {"job_id": "...", "status": "queued"}; then poll:
curl https://api.aiipworld.com/v1/jobs/JOB_ID -H "Authorization: Bearer $AIIPWORLD_API_KEY"
```

Map your settings like this. The page format and orientation you gave jsPDF become format and landscape. Page margins become margin. Page break handling moves to CSS rules such as break-inside: avoid. Images need public addresses, or data URLs, because the server cannot see files on the visitor's computer. The job is asynchronous: you poll until it succeeds and then download the file from a short-lived link.

## How to test with your own pages

Run your real pages through both and check the points below.

- Text: open the PDF and try to select a word, search for it and copy it.
- Page breaks: check where tables, cards and headings fall at the end of each page.
- Fonts: confirm that every font you use is on the render server or loads from a public URL.
- Size: compare the file size of a long document.
- Cost: the library is free to run. The API uses 1 credit for a simple render, and larger outputs use more. Credit costs are provisional until launch.

## Questions

### Is AIIPWorld a replacement for html2pdf.js?

For some uses. html2pdf.js runs in the visitor's browser. We run on a server, so we replace it only where your code can send HTML to an API and wait for a job to finish. If you want the PDF to be made on the visitor's device without a server, keep using a browser library.

### Does html2pdf.js work in Node.js?

Its README says it will not run in Node.js and must run in a browser. For a PDF in Node.js, call the API with fetch, or run a browser such as Puppeteer. The Node.js guide on this site shows both.

### What is a good html2canvas alternative?

It depends on what you need. html2canvas draws a picture of the page in the visitor's browser. If you need an image of a page made on a server, the screenshot API renders a URL or HTML in headless Chromium and returns a PNG or JPEG.

### What is a jsPDF alternative for HTML?

jsPDF writes PDF files in the browser, and its html() method depends on html2canvas. If your starting point is HTML and you want selectable text, send the HTML to a server that prints it with Chromium, such as this API.

### Why is the text in my html2pdf.js PDF not selectable?

The html2pdf.js README says it renders the content into an image and then places that image into the PDF, so the text is not selectable or searchable. A PDF printed by Chromium keeps text as text.

### Can I call the API from browser JavaScript?

You can, but you should not put the API key in code that visitors can read. Call your own backend from the browser, and let the backend call the API.

### Which libraries are licensed under MIT?

The repositories of html2pdf.js, html2canvas and jsPDF each show the MIT licence. Check the licence again in the repository before you rely on it.

### How current is the information about the libraries?

It was checked on 2026-10-11 against github.com/eKoopmans/html2pdf.js, github.com/niklasvh/html2canvas and github.com/parallax/jsPDF. READMEs change, so confirm on the repositories before you decide.

## Related

- [HTML to PDF converter](https://aiipworld.com/tools/html-to-pdf/index.md)
- [PDF generator API](https://aiipworld.com/pdf-api/index.md)
- [Print CSS for PDF: a practical guide](https://aiipworld.com/guides/print-css-for-pdf/index.md)
- [HTML to PDF nodejs: a Node.js API guide](https://aiipworld.com/guides/html-to-pdf-nodejs/index.md)
- [AIIPWorld as a Browserless alternative](https://aiipworld.com/alternatives/browserless/index.md)
- [URL to PDF](https://aiipworld.com/tools/url-to-pdf/index.md)

Page: https://aiipworld.com/alternatives/html2pdf-js/
