Blog

Back to blog posts

Web service to convert HTML + CSS to PDF

Published Mar 23, 2019

Intro

API2PDF is a web service for generating PDFs at massive scale. Our mission is to make the experience of generating PDFs for application developers not completely miserable.

Our system is designed with extreme scalability in mind and is ready for enterprise use. We are built on a serverless architecture, AWS Lambda, which means we can scale to millions of request at a very low cost. We pass those savings on to you with a Pay As You Go model. This works great whether you are generating ten PDFs per month as a solo developer, or millions of PDFs per month as a leading enterprise.

There are no file size limits or rate limits.

HTML to PDF API

We are primarily known for our HTML to PDF conversion and offer a wrapper for the two most popular open-source PDF rendering engines: wkhtmltopdf and Headless Chrome. Headless Chrome is a newer engine and is recommended for future projects.

The API is REST based, and our core documentation is available here: https://www.api2pdf.com/documentation

For both wkhtmltopdf and Headless Chrome, we support converting HTML to PDF directly, or passing a URL to an existing website and converting that web page to a PDF.

Additionally, you can specify advanced options for both of those endpoints if you wish to change margins, page sizes, orientation, headers, footers, page numbers, and really any of the available functionality that comes with the underlying technologies. See all of the advanced options and how to use them below.

To use the API, you can quickly grab an API Key and get started in minutes by going here.

Client Libraries for HTML to PDF Conversion

We conveniently offer client libraries and SDKs for our HTML to PDF API to speed up development.

Feel free to star or fork the repositories on Github. Some customers have submitted pull requests to improve the libraries and we are always welcome to that.

Security

When a PDF is generated, you are provided a URL to the PDF that is hosted on our Amazon S3 bucket. This PDF will only exist on S3 for 24 hours before automatically being deleted. For more sensitive PDFs, you have the ability to delete your PDF immediately. See this article for details.

Some customers have very strict security requirements and insist on running API2PDF within their own AWS account. This is an option, and our Lambda functions are for sale.

Cost

We charge $1/mo + usage. We are so low cost that no other competitor comes even remotely close to our pricing. On top of that, we have no file size or rate limits while other services do. To use our service, drop in a few dollars and start generating PDFs. It works like a pre-paid phone with minutes on it. The more PDFs you generate, your balance starts to decrease. You can set it to auto-recharge your account or make a one time payment at any time.

See our pricing details and cost estimator.

Support

Email [email protected] or use the Support tab when logged into your client portal.

We respond to all inquiries within 1 business day. This product is built by developers, for developers and so when you write in, you will get a response from a developer. Do your best to help us out and provide us with all the relevant information so that we can provide the best support possible. Include the endpoint you are using, sample payloads, description or screenshots of any errors you are getting, etc.

Check out our post on how to use our swagger documentation for easy testing.

We’ll do a best effort to help you find where the bug is in your code. Sometimes we get requests to write code, but that goes a bit beyond the level of support we can provide. For code assistance, you should try posting to stackoverflow.com.

Conclusion

We hope you sign up and use your free trial to generate PDFs and give us a try. You are minutes away from generating PDFs! Get your API Key here.

In case you are curious, we offer more than just HTML to PDF conversion! Here are some other API endpoints we offer our customers:

  • Office documents to PDF with LibreOffice
  • Merge PDFs together
  • Barcode and QR code generation with Zebra Crossing (ZXING)

Thanks for visiting and don’t hesitate to reach out if you have any questions about our service.