Getting Started
PDFPixels provides a free public API for image and PDF processing. No authentication required. Just make HTTP requests to our endpoints.
60/min
Rate Limit
100MB
Max Image Size
500MB
Max PDF Size
API Endpoints
POST
/api/image/processImagePOST
/api/pdf/mergePDFPOST
/api/pdf/splitPDFPOST
/api/pdf/compressPDFPOST
/api/pdf/to-imagePDFPOST
/api/pdf/from-imagePDFCode Examples
Compress Image
// Compress an image
const formData = new FormData();
formData.append('image', imageFile);
formData.append('quality', '85');
formData.append('format', 'webp');
const response = await fetch('https://pdfpixels.com/api/image/process', {
method: 'POST',
body: formData
});
const result = await response.json();
console.log('Compressed image:', result.imageUrl);
console.log('Saved:', result.savedPercent + '%');Resize Image
// Resize an image
const formData = new FormData();
formData.append('image', imageFile);
formData.append('width', '800');
formData.append('height', '600');
formData.append('fit', 'inside');
const response = await fetch('https://pdfpixels.com/api/image/process', {
method: 'POST',
body: formData
});
const result = await response.json();
console.log('Resized dimensions:', result.originalDimensions);Merge PDFs
// Merge PDFs
const formData = new FormData();
formData.append('files', pdfFile1);
formData.append('files', pdfFile2);
formData.append('files', pdfFile3);
const response = await fetch('https://pdfpixels.com/api/pdf/merge', {
method: 'POST',
body: formData
});
const result = await response.json();
console.log('Merged PDF:', result.pdfUrl);
console.log('Total pages:', result.pageCount);Split PDF
// Split PDF
const formData = new FormData();
formData.append('file', pdfFile);
formData.append('mode', 'range');
formData.append('pageRange', '1-3,5,7-9');
const response = await fetch('https://pdfpixels.com/api/pdf/split', {
method: 'POST',
body: formData
});
const result = await response.json();
console.log('Extracted pages:', result.extractedPages);Image Processing Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
image | File | Yes | Image file to process (max 100MB) |
quality | Integer | No | Output quality 1-100 (default: 85) |
format | String | No | Output format: jpg, png, webp, avif, gif, tiff |
width | Integer | No | Target width in pixels |
height | Integer | No | Target height in pixels |
targetSize | Integer | No | Target file size in KB |
rotate | Integer | No | Rotation angle -360 to 360 |
brightness | Float | No | Brightness 0.5-2.0 (1.0 = normal) |
contrast | Float | No | Contrast 0.5-2.0 (1.0 = normal) |
saturation | Float | No | Saturation 0.5-2.0 (1.0 = normal) |
blur | Float | No | Blur radius 0-20 |
grayscale | Boolean | No | Convert to grayscale |
Response Format
Success Response
{
"success": true,
"imageUrl": "data:image/webp;base64,...",
"originalSize": 1048576,
"processedSize": 524288,
"savedBytes": 524288,
"savedPercent": 50,
"originalDimensions": {
"width": 1920,
"height": 1080
},
"format": "webp",
"mimeType": "image/webp",
"quality": 85
}