PDF Generation, Powered by Serverless
We make the experience of generating PDFs for application developers not completely miserable. Get started in minutes using our ridiculously powerful REST API.
#python example
import requests
import json
api_key = 'your-api-key'
endpoint = 'https://v2.api2pdf.com/chrome/pdf/html'
html_to_convert = '<p>Hello World</p>'
api_response = requests.post(endpoint, json={'html': html_to_convert}, headers={'Authorization': api_key})
print(json.loads(api_response.content)['FileUrl'])
Features
DOCUMENT CONVERSION
Convert images and Microsoft Office documents (Word, Powerpoint) to PDF format with LibreOffice
Learn moreTry It Out
Convert HTML to PDF with Headless Chrome
Convert a URL to PDF with Headless Chrome
Convert an Office Document to PDF with LibreOffice
Generate PDFs at Massive Scale on Serverless Architecture
Mission Statement
Api2Pdf’s mission statement: Make the experience of generating PDFs for application developers not completely miserable.
Generating PDFs should be fast, cheap, and have no limitations. Popular libraries and APIs like iTextSharp, PDFCrowd, and DocRaptor are unreasonably expensive. You shouldn’t have to break the bank to convert HTML to PDF on Google Cloud Run.
Transparency
Our other promise to our customers is transparency. Most API services out there do not publicize what PDF rendering engines they use under the hood. We are the opposite - we are proud to share with you that we offer the tools you already use: wkhtmltopdf, Headless Chrome, and LibreOffice. The problem that most application developers run into is that since so many websites are moving to cloud hosting environments, running these PDF engines have an added layer of complexity. It is not trivial, for example, to run wkhtmltopdf on Heroku. On top of that, it is not cost effective either. Wkhtmltopdf on Google Cloud Run in a docker container is the perfect use-case for HTML to PDF conversion and URL to PDF conversion. However, configuring wkhtmltopdf and Headless Chrome on Google Cloud Run can take up valuable time and resources from your development team. That is why we did the heavy lifting for you.
Api2Pdf also provides the much beloved LibreOffice on Google Cloud Run in a docker container. LibreOffice is fantastic because it allows you to convert dozens of file types to PDF including Word to PDF, PowerPoint to PDF, Excel to PDF, and Publisher to PDF. Besides Microsoft Office documents, it is capable of converting images too, such as JPEG, PNG, GIF, and BMP. But in actuality, it can convert any file that can be opened in LibreOffice to PDF. For example, TXT to PDF and EML to PDF is possible. Any file that can be reasonably printed is a candidate for the LibreOffice endpoint.
Merging PDFs is another challenge - and one that most of the PDF generation API services do not provide solutions for. Api2Pdf helps you merge pdfs on Google Cloud Run by passing the endpoint a list of URLs to existing PDFs. Api2Pdf will consume those PDFs and combine them all together in the order you specified. Merging PDFs together is quite CPU intensive, and so offloading this to a serverless architecture can reduce the load on your web application.
And last, but not least, the barcode generation API is a nice-to-have. PDFs and barcodes go well together. Printing invoices and receipts to PDF with wkhtmltopdf or Headless Chrome and including a barcode is a very common task that our customers perform.
HTML to PDF Use Cases
Here are just some of the common use cases for converting HTML to PDF with wkhtmltopdf or Headless Chrome.
- Print invoice or receipt to PDF
- Print a packing slip or shipping label to PDF
- Generate a PDF of an eBook or shopping catalogue
- Create executive and financial reports in PDF format
- Data visualization in PDF format with HighCharts or AnyChart
- Convert a website to print friendly format
- Print applications and nominations to PDF
- Convert emails to PDF for law firms and legal documentation
- Convert resumes and job applications to PDF
If you have another HTML to PDF use case, we would love to hear about it.
Supported Programming Languages
Api2Pdf is a REST API. This means that you can use the API with any programming language. Our documentation for the service lives on our SwaggerHub account here. However, we do offer client libraries to generate PDFs in Python, PHP, and C#. More are coming soon.
We hope you enjoy our product. If you have any questions, do not hesitate to reach out. Thank you.