Documentation

How to use this PDF Generation API

Our PDF generation service is designed to be simple. If you have ready-made HTML content, you can pass it directly to our API for instant conversion into a PDF document. If your HTML content is hosted online, simply enter the URL and our service will fetch the HTML code from the Internet with a real headless browser.

There is an optional property called vars that accepts a JSON object. This data is then dynamically inserted into the HTML document using handlebars in the background.

Getting started with our service is straightforward: simply choose the plan that fits your needs and register. Once subscribed, you'll gain access to our RapidAPI PDF endpoint. This endpoint can be utilized with your preferred programming language, offering you the flexibility to integrate PDF generation into your applications with ease.

Go to RapidAPI

cURL Example with URL

 curl --request POST \
	--url https://pdfgenerator.p.rapidapi.com/pdf \
    --header 'Accept: application/pdf' \
	--header 'X-RapidAPI-Host: pdfgenerator.p.rapidapi.com' \
	--header 'X-RapidAPI-Key: 90144518e8msh2e0250d70209f2cp19eaeejsnf674dc984054' \
	--header 'content-type: application/json' \
	--data '{
    "url": "https://sparksuite.github.io/simple-html-invoice-template"
}' > document.pdf 

cURL Example with HTML + vars

curl --request POST \
--url https://pdfgenerator.p.rapidapi.com/pdf \
--header 'Accept: application/pdf' \
--header 'X-RapidAPI-Host: pdfgenerator.p.rapidapi.com' \
--header 'X-RapidAPI-Key: 90144518e8msh2e0250d70209f2cp19eaeejsnf674dc984054' \
--header 'content-type: application/json' \
--data '{ "html": " {{title}} ", "vars": {"title": "Hello World"}}' > document.pdf 

cURL Example with HTML Code

 curl --request POST \
	--url https://pdfgenerator.p.rapidapi.com/pdf \
    --header 'Accept: application/pdf' \
	--header 'X-RapidAPI-Host: pdfgenerator.p.rapidapi.com' \
	--header 'X-RapidAPI-Key: 90144518e8msh2e0250d70209f2cp19eaeejsnf674dc984054' \
	--header 'content-type: application/json' \
	--data '{
    "html": "<html lang=\"en\"> <head> <meta charset=\"UTF-8\"> <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"> <title>Invoice</title> </head> <body> <h1>Invoice</h1> <table> <tr> <th>Position</th> <th>Description</th> <th>Amount</th> <th>Price per Piece</th> <th>Total</th> </tr> <tr> <td>1</td> <td>Product A</td> <td>2</td> <td>€10,00</td> <td>€20,00</td> </tr> <tr> <td>2</td> <td>Product B</td> <td>3</td> <td>€15,00</td> <td>€45,00</td> </tr> <tr> <td>3</td> <td>Product C</td> <td>1</td> <td>€25,00</td> <td>€25,00</td> </tr> </table> <p>Total: €90,00</p> </body> </html>"
}' > document.pdf 

PDF Generation Service API
?