DocRaptor HTML TO PDF API
The World's Most Advanced

HTML to PDF API

DocRaptor is the only HTML to PDF API that uses the Prince PDF generator, has a 99.99% uptime guarantee, and is both SOC2 and HIPAA compliant.

Unique Functionality

Prince's powerful PDF rendering engine provides HTML-to-PDF conversion capabilities that other APIs can't match.

Page Flexibility

Only DocRaptor lets you mix and match different page sizes, styles, and headers and footers all within the same PDF document.

PDF Forms

Automatically convert your raw HTML forms into PDF forms, including accessible forms for screen readers.

Accessible PDFs

DocRaptor's automatic tagging and CSS-based tagging features make it easy to create PDF files that meet WCAG 2.0, Section 508, and ISO-14289 accessibility standards.

Integrated Headers & Footers

Use simple CSS and HTML to define repeating (or non-repeating!) headers and footers within your HTML file.

Advanced Floats

Your content, including footnotes, charts, and images, can be floated to the top or bottom of pages or the inside/outside of books with left and right pages.

PDF-Specific JavaScript

Prince's JavaScript provides advanced PDF scripting opportunities, including direct access to PDF objects and multiple rendering passes.

And more…

Add crop marks, specify PDF bookmarks, use TIFF images, convert to CMYK, include printer's marks, and more!
See Code Samples
Get
Started
Finished Fast
DocRaptor’s HTML-to-PDF API and supporting resources are designed to help developers quickly create a high-quality PDF.

Libraries & Example Code

Easy-to-use libraries and code examples are available in every major programming language, including C#, Java, JavaScript, jQuery, .NET, Node, PHP, Python, Rails, Ruby, and more.

Free Test Documents

Every account includes unlimited watermarked test documents. Test your document content and styling as much as you need, without worrying about extra charges.

No-Signup Required

Our demo lets you try the API without signing up, and all of our HTML-to-PDF source code examples include our public and free test-mode key, YOUR_API_KEY_HERE.

Instant Scalability

DocRaptor infrastructure is ready to handle any throughput or size requirements. We have no limits on document input or output size; and all documents cost the same, regardless of their size or generation time.

Document Hosting

DocRaptor can host your PDFs at an unbranded URL, which you can provide to your end-users or input to third-party tools like Zapier and Salesforce.

Professional Support

High-quality PDFs can be surprisingly tricky to develop. Our support team has years of experience helping to create the perfect PDF and only an email or chat away.
See Example Code
Trust & Reliability
99.99% Uptime Guaranteed
For over a decade, our high-scale infrastructure has been the trusted PDF generator for organizations like Shopify, Wiley, HubSpot, Square, Accenture, and thousands more.
Trust & Reliability
Encrypted In Transit and At Rest
PDF document input and output are encrypted during transit and when not in use by the conversion processes. We care deeply about maintaining the privacy of your information.
Trust & Reliability
SOC2, HIPAA & GDPR
With a strong record of standards compliance, DocRaptor's HTML-to-PDF API can be used regardless of your geographic location or industry, even for electronic protected health information.
Review Security & Privacy Policies

DocRaptor is stupid simple to use. Really happy with how fast it is.

Adam Valverde
Adam Valverde
Director Of Engineering, Virtuous

We have definitely saved money and time. Without DocRaptor, we'd have to manage a server, pay for storage, and manage a whole piece of software tangential to our core business.

Rory Douglas
Rory Douglas
President, Clean Catalog
See Case Studies & Top Customers

Why HTML-to-PDF?

DocRaptor is a REST HTML-to-PDF conversion API, but you can also generate PDFs with non-HTML libraries such as LaTex, jsKit, and PDFKit. In our experience, though, HTML and CSS offer many advantages including:

Layout & Tables

Raw HTML code supports flexible structures such as tables, flexboxes, columns, and floats. Most non-HTML-to-PDF converters force you to lay out each element or table cell to specific pixel locations.

Code Reuse

Many PDF projects involve existing HTML or XML documents, such as web pages or Excel exports. Reusing existing code and custom CSS styling speeds up document development and keeps your code DRY.

Third-Party Libraries

Quickly enhance your documents with millions of HTML, CSS, and JavaScript frameworks and libraries, including Bootstrap, Tailwind, jQuery, and Google Maps.

Responsive Design

HTML documents can be styled responsively for different size documents or displays. With DocRaptor, it's simple to transform the same document into US-Letter or A4 page sizes.

Render-Time Changes

DocRaptor and PrinceXML's powerful JavaScript capabilities let you transform your document at render time so you can dynamically create table of contents, page indexes, or even textfit headline sizes.
Since HTML and CSS were built for creating, styling, and laying out documents, it's faster to use those programming languages for building PDF documents. Not just for the initial development, but for future edits and changes as well.
vs

DocRaptor vs Other PDF Converters

We believe DocRaptor is the highest-quality, fastest, and most cost-effective PDF conversion tool. But you don’t have to take our word for it–do your own research. Start with these questions:

Can you reuse an existing HTML document?

Does it use JavaScript? If you have a raw HTML document already, obviously, an HTML-to-PDF conversion saves you time and energy. And if you need JavaScript support, you’ll want to use DocRaptor, PrinceXML, or a browser-based library.

Is your document long or complex?

A mostly text-based or one-page document can be created with almost any PDF conversion engine. But documents with complex layouts, dynamic references (such as indexes or table of contents), lots of charts or images, varying headers or page sizes, etc, can be difficult in many libraries. To save development time, test the most complex parts of your document first.

How much development and maintenance can you afford?

There is a wide discrepancy in feature support and bug-free operation between different converters. Maintaining a high-scale infrastructure can be costly as PDFs are slow and CPU-intensive to generate (compared to web pages). Compare the development time and maintenance costs of your PDF conversion options early in your selection process.

How much support do you need?

After answering the above questions, you should have a good understanding of the level of support you require. Selecting a PDF converter API with an expert support team—like DocRaptor—can dramatically speed up your implementation timelines.

Prince

Prince pioneered HTML-to-PDF technology with the first release of PrinceXML in 2003 and has been leading the category ever since. The chairman of Prince (and the inventor of CSS), Håkon Wium Lie, also wrote the first CSS Paged Media W3C specifications, which enable much of Prince and DocRaptor’s unique functionality. DocRaptor's primary difference versus Prince is our lower starting price point and instant scalability.

Headless Chromium

Google Chrome provides modern CSS and JavaScript support. It's an excellent choice for simple documents or web pages created from complex JavaScript, but its focus on web pages makes Chrome struggle with complex documents with PDF-specific styling, floats, JavaScript, accessibility, etc. The resource usage of web browsers may increase infrastructure and scalability needs, especially when you need to convert multiple web pages quickly.

Other APIs

There are countless HTML-to-PDF API alternatives available on the internet. Most of these online tools are significantly cheaper than DocRaptor, but that's because they're all based on Headless Chrome and generally managed by companies less focused on reliability and security. These other APIs will struggle with complex PDFs.

WeasyPrint

WeasyPrint is the only major HTML-to-PDF library not based on a browser. While it lacks JavaScript support, it does offer more PDF-focused functionality than Headless Chrome. It still falls far behind Prince and DocRaptor's capabilities.

wkhtmltopdf / PhantomJS

Historically, wkhtmltopdf and PhantomJS were the primary open-source libraries to convert web pages into a Portable Document Format (PDF). Now, they're both deprecated, buggy, lacking support for modern CSS, have poor typography, and are a pain to install. Stick with the Headless Chrome-based libraries if you want to convert HTML files with a browser.
We created DocRaptor because we weren’t satisfied with any of the alternatives. It is a terrific HTML-to-PDF API, and likely to be the most cost-effective solution for most conversion projects when you consider the total project cost.

Frequently Asked Questions

If you don't find what you're looking for, don't hesitate to reach out to our support team. We are here to help you make the most out of DocRaptor!

How do I convert HTML to PDF automatically?

Automatic conversion of HTML to a generated PDF document can be achieved via an Application Programming Interface (API) such as DocRaptor, or through automation tools like Zapier or Kotive. While crafting a single PDF file is simple, when creating multiple documents or dynamic documents from a database, an API is your best bet!

How to convert HTML to PDF for free?

DocRaptor is one of the few free HTML to PDF APIs. Other APIs offer limited free trials, but you can try DocRaptor without any time pressure. We also provide a public API key so you can create test (watermarked) documents without creating an account at all.

Can't I convert HTML to PDF in Chrome?

Yep! You can easily "print" a single web page into PDF format from the Chrome browser. DocRaptor also converts web pages into PDFs, but we do so via an API that allows developers to convert HTML documents by the thousands instead of one at a time.

What other file formats do you support?

DocRaptor can convert HTML files into high quality PDF documents or XLS/XLSX files. Unfortunately, we don't support Zip files or other any other file formats at this time.
Feature List
Here's a more complete list of features, to better consider DocRaptor’s key advantages:
HTML & CSS
  • Headers & Footers
  • Watermarks
  • Footnotes & Sidenotes
  • Columns
  • Cross-References
  • Page Floats
  • CSS Transforms
  • Page Breaks
  • Page Numbers & Counters
  • Custom Margins
  • Custom Page Sizes
  • Landscape & Portrait Page Orientation
  • Named Pages
  • First Page / N-Page Styling
  • Full-Bleed PDFs
  • Background Images
PDF Output
  • Accessible PDFs
  • Printer's Marks
  • PDF Bookmarks
  • PDF Profiles
  • PDF Links
  • PDF Forms
  • Font Embedding & Subsetting
  • OpenType, TrueType, and CFF Fonts
  • Password-Protected PDFs
  • Disallow Print, Modification, or Copy
  • Encrypted PDFs
  • Adjust DPI
PDF Generation
  • Free Test Documents
  • Asynchronous Generation
  • Parallel Generation
  • Hosted Documents
  • Multi-Pass JavaScript
  • No Size Limits
  • Encrypted in Transit
Ready to get started?
Create a free account
Get up and running in minutes. Our support team is here to help craft the perfect document!
Sign up for Free
Add one of our agents
Use a no-signup-required testing API key to test the waters in your programming language.
Setup Agents