Welcome to the PDF Processing API! Convert PDF documents to text or images with ease using our simple API endpoints.
To get started, make a POST request to the endpoints listed below. All requests must be sent with a Content-Type
of application/json
.
Maximum File size is - 50MB
/pdf-to-text
pdfBase64
: A string containing the base64-encoded PDF content./pdf-to-image
pdfBase64
: A string containing the base64-encoded PDF content.Responses will be returned in JSON format. A successful response for the PDF to text endpoint will contain the extracted text. For the PDF to image endpoint, a link to download a zip file containing the images will be provided.
const fs = require('fs');
const axios = require('axios');
const pdf = fs.readFileSync('sample.pdf', {
encoding: 'base64'
});
// Your API endpoint
const apiEndpoint = '...enpoint/pdf-to-text';
// Set up the axios POST request
axios.post(apiEndpoint, {
pdfBase64: pdf
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});
{
"text": "Extracted text content...",
"formatedText": "Formatted extracted text content..."
}
const fs = require('fs');
const axios = require('axios');
const pdf = fs.readFileSync('sample.pdf', {
encoding: 'base64'
});
// Your API endpoint
const apiEndpoint = '...enpoint/pdf-to-image';
// Set up the axios POST request
axios.post(apiEndpoint, {
pdfBase64: pdf
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});
{
"link": "..../temp/pdf-images-uniqueID.zip"
}
Generated PDF file will be deleted after 1 Hour of creation.
If thereโs an error with your request, the API will return an error status code and a JSON object with an error key describing the issue.
{
"error": "Description of the error."
}
Please note that there are rate limits in place to ensure fair usage. Contact support for more details on the limits and how to accommodate higher usage.