PDF Generator API is now live on Product Hunt! PDF Generator API
is a flexible Web API and template editor for PDF generation. Using PDF Generator API, you can easily embed transactional PDF document creation into your application. It's got a drag-and-drop editor that taps into end-user data to make PDFs.
I admire APIs that do one thing and do it really well, and PDF Generator API epitomizes that idea. It's a business processing utility executed well by a solid team with years of experience focusing on a single idea: automating the PDF documentation generation process.
What's The Use Case?
Many document-heavy business applications, like an eCommerce shop, accounting firm, or an ERP platform, need to generate PDFs for things like invoices, packing slips, contracts, and labels. The issue is that manual PDF creation is pretty tedious. So, a lot of these scenarios will create reusable templates. PDF Generator API is automating this process, helping avoid development duplication, and aiding in custom template creation.
Designing Templates
PDF Generator API offers an embeddable drag-and-drop editor so that end-users can design their own custom templates. Users choose how their data will be shown, within Text, Tables, Containers, and other fields, or you can generate standard Images and Footers to include in all your PDFs. Once you create a template, you merge them with your data by using the REST API to generate PDFs. You can upload a JSON file to try out using the editor without an integration.
Developer Resources
PDF Generator API excels at appeasing many use cases. Docs come handy with copy and pastable code samples in PHP, Python, Java, Ruby, and other languages & frameworks. You can also view JSON responses and error messages for any function.
Accounts & Pricing
PDF Generator API offers a pretty generous free account, allowing up to 500 merges per month. Beyond that, you can check out their
pricing
plans.
Sample Invoice Creation Using PDF Generator API: eCommerce SaaS To see how PDF Generator API works in action, let's consider how a business would use it to streamline PDF creation. Say our company is a document-heavy business, like an eCommerce SaaS. The eCommerce SaaS enables users to send invoices to end customers on a monthly basis.
Our users require custom designs for PDF invoices to match their storefront branding and to display up-to-date information. However, fulfilling their needs through development cycle is expensive. The eCommerce SaaS wants to avoid extra costs from developers and support so that the customer themselves can build their templates.
The goal is to create a reusable, automated process to generate PDFs on a large scale, while allowing for customization. First, we design a PDF template using drag-and-drop widgets. These include text fields, columns, images, QR codes, and more. We can customize color and fonts to match our company brand. You can view an active demo template
here.
Next, we insert data fields by choosing which property to display and where. For example, one text box uses the {invoice_date} field to display the date. {invoice_number}
is used to insert the invoice number. Multiple fields can be inserted in the same text box. Such as the following company information:
{company}
{address1}
{city}
You can even write in expressions to accumulate sums. In this case, the expression ${% sum({line_items::total_cost}) %}
calculates the total cost of good and services. Once the template is finished, to create a PDF we must merge the template with an API request that sends JSON formatted with the identical field names. We make an API request to the base URL endpoint
https://us1.pdfgeneratorapi.com/api/v3
with our API key.
To demonstrate, here is some sample JSON which would be sent with the API request:
{ "invoice_number": "4698018857", "phone_number": "(978) 555-7555", "email_id": "johnmiller@pdfgeneratorapi.com", "name": "John Miller", "logo": "https://www.onlinelogomaker.com/images/tutorialnew/tutorial.jpg", "customer_memo": "Thank you for your business and have a great day!", "period": "July period", "invoice_date": "2019-08-03", "address1": "2 Maple St", "phone": null, "city": "New Milford", "zip": "18834-2014", "province": "Pennsylvania", "country": "United States", "last_name": "LeBron", "address2": null, "company": "ACME Company Inc", "credit": { "balance": 0.0 }, "line_items": [ { "total_cost": 182, "hours": 7, "fee": 12, "description": "DB Architecture", "note": "Database architecture focuses on the design, development and implementation." }, { "total_cost": 189, "hours": 9, "fee": 29, "description": "Analysis", "note": "Detailed examination of anything complex in order to understand its nature or to determine its essential features" }, { "total_cost": 175, "hours": 5, "fee": 15, "description": "Web scrapping", "note": "Web scraping, web harvesting, or web data extraction is data scraping used for extracting data from websites" }, { "total_cost": 160, "hours": 8, "fee": 10, "description": "Web design", "note": "Responsible for creating the design and layout of a website or web pages" } ] }
On the client-side, you could export a PDF from the editor. Though, since it's API-driven, the exact process is super flexible. You could create a form to input this data, or hook into your CRM systems.
The end result is a slick PDF to send to our client! PDF Generator API can also generate an HTML version to reduce file size and bloat. You can view a sample HTML version here.