Convert each page of a PDF into high-resolution PNG images – perfect for previews, thumbnails, or image-based processing.
Make sure that the response type is set to PNG.
const { PDF2PNG } = require('./utils');
const pdfInput = input.file || input.url;
return PDF2PNG(pdfInput, input.pageRange);
This example shows how to convert the first page of a PDF to a PNG image from a given URL:
curl -X POST https://e.customjs.io/zeXXXy \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-d '{
"url": "https://css4.pub/2017/newsletter/drylab.pdf"
}' --output test-by-url.png
This example shows how to convert the first page of your PDF by sending a Base64-encoded binary string. Keep in mind that the payload size is limited to 6 MB.
curl -X POST https://e.customjs.io/zeXXXy \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-d '{
"file": "JVBERi0x..........EyNzg3CiUlRU9GCg=="
}' --output test-by-string.png