Complete PDF toolkit API: merge, split, compress, rotate, watermark, extract text, add page numbers. Free tier available.
A PDF API is a powerful tool for generating, converting, and manipulating PDF documents programmatically. It allows developers to create PDFs from various sources, such as HTML, URLs, and other PDFs, and perform operations like merging, watermarking, and compressing. With a PDF API, you can automate tasks, improve efficiency, and enhance the overall user experience.
At DevProToolkit API platform, we provide a robust and scalable PDF API that can be easily integrated into your application. Our API is designed to handle a wide range of use cases, from generating invoices and reports to creating contracts and certificates. With our API, you can focus on developing your core product while we take care of the PDF generation and manipulation.
Generate a PDF instantly — no API key needed for the playground.
Open PDF API PlaygroundA PDF API is an application programming interface that allows developers to interact with a PDF generation and manipulation system. It provides a set of endpoints and parameters that can be used to create, convert, and manipulate PDF documents programmatically.
While libraries can be used to generate and manipulate PDFs, a PDF API offers several advantages. It provides a scalable and reliable solution, handles complex tasks, and requires minimal maintenance and updates. Additionally, a PDF API can be easily integrated into your application, allowing you to focus on developing your core product.
To get started with our PDF API, follow these simple steps:
X-API-Key header.Our PDF API provides the following endpoints:
GET/POST /api/pdf/generate: Generate a PDF document from HTML content or a URL.GET/POST /api/pdf/convert: Convert a PDF document to another format.GET/POST /api/pdf/merge: Merge multiple PDF documents into a single document.The following parameters are supported:
| Parameter | Description |
|---|---|
html_content |
The HTML content to generate the PDF from. |
url |
The URL to generate the PDF from. |
page_size |
The page size of the generated PDF. |
orientation |
The orientation of the generated PDF. |
margin |
The margin of the generated PDF. |
watermark_text |
The watermark text to add to the generated PDF. |
curl -X POST \
https://api.commandsector.in/api/pdf/generate \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"html_content": "..."}'
curl -X POST \
https://api.commandsector.in/api/pdf/generate \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"url": "https://example.com"}'
import requests
api_key = 'YOUR_API_KEY'
url = 'https://api.commandsector.in/api/pdf/generate'
data = {'html_content': '...'}
headers = {'X-API-Key': api_key, 'Content-Type': 'application/json'}
response = requests.post(url, json=data, headers=headers)
if response.status_code == 200:
print('PDF generated successfully')
else:
print('Error generating PDF')
const fetch = require('node-fetch');
const apiKey = 'YOUR_API_KEY';
const url = 'https://api.commandsector.in/api/pdf/generate';
const data = { html_content: '...' };
const headers = { 'X-API-Key': apiKey, 'Content-Type': 'application/json' };
fetch(url, { method: 'POST', body: JSON.stringify(data), headers })
.then(response => response.json())
.then(data => console.log('PDF generated successfully'))
.catch(error => console.error('Error generating PDF', error));
Our PDF API can be used in a variety of scenarios, including:
The DevProToolkit API platform offers a range of advanced features to enhance your PDF generation, including watermarks, headers and footers, page numbers, custom fonts, and password protection. These features allow for a high degree of customization and control over the output.
For example, to add a watermark to your PDF, you can use the following curl command:
curl -X POST \
https://api.commandsector.in/pdf \
-H 'Content-Type: application/json' \
-d '{"html": "Hello World
", "watermark": {"text": "Confidential", "opacity": 0.5}}'
This will generate a PDF with the specified HTML content and a watermark with the text "Confidential" at 50% opacity.
When choosing a solution for generating PDFs, it's essential to consider the trade-offs between different approaches. The following table compares the DevProToolkit PDF API with popular client-side libraries:
| Solution | Language | Setup Complexity | Serverless Compatible | Custom Styles | Output Quality |
|---|---|---|---|---|---|
| DevProToolkit PDF API | Any | Low | Yes | High | High |
| wkhtmltopdf | C++/Qt | Medium | No | Medium | Medium |
| Puppeteer | JavaScript | High | Yes | High | High |
| WeasyPrint | Python | Medium | No | Medium | High |
This comparison highlights the advantages of using the DevProToolkit PDF API, including low setup complexity, serverless compatibility, and high customizability.
The DevProToolkit PDF API can be easily integrated with a variety of frameworks and libraries. Here are some examples:
Django: Use the `requests` library to send a POST request to the API endpoint, passing in your HTML content and any desired options.
import requests
response = requests.post('https://api.commandsector.in/pdf', json={'html': 'Hello World
'})
Express.js: Use the `axios` library to send a POST request to the API endpoint, passing in your HTML content and any desired options.
const axios = require('axios');
axios.post('https://api.commandsector.in/pdf', { html: 'Hello World
' })
React: Use the `fetch` API to send a POST request to the API endpoint, passing in your HTML content and any desired options.
fetch('https://api.commandsector.in/pdf', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ html: 'Hello World
' }) })
To ensure optimal PDF generation, follow these best practices:
1. Optimize your HTML: Keep your HTML content simple and well-structured to improve rendering performance.
2. Use font loading strategies: Implement techniques like font caching or asynchronous font loading to reduce the impact of font rendering on performance.
3. Handle images efficiently: Use image compression and caching to minimize the size and loading time of images in your PDFs.
4. Leverage CSS styles: Utilize CSS to control the layout and appearance of your PDF content, rather than relying on inline styles or HTML attributes.
5. Test and iterate: Verify the quality and accuracy of your generated PDFs, and make adjustments as needed to ensure the best possible output.
6. Monitor performance: Keep an eye on the performance of your PDF generation workflow, and optimize it as needed to ensure fast and reliable output.
| Plan | Requests per Day | Price |
|---|---|---|
| Free | 100 | $0 |
| Pro | 10,000 | $9.99/mo |
| Enterprise | Unlimited | Contact us |
We support a wide range of formats, including PDF, HTML, and various image formats.
We support all standard page sizes, including A4, Letter, and Legal.
Yes, we take security very seriously and use industry-standard encryption to protect your data.
No, our free plan is completely free and does not require a credit card.
Our file size limits vary depending on the plan you choose, but our Pro plan supports files up to 100MB.
Get your free API key and start making requests in minutes.
curl "http://147.224.212.116/api/..." \
-H "X-API-Key: YOUR_API_KEY"
Get a free API key with 100 requests/day. No credit card required.
Get Free API Key