Skip to content

Instantly share code, notes, and snippets.

@symisc
Created July 18, 2025 18:03
Show Gist options
  • Save symisc/1b76bc13d249da453c4d0ed33f31c018 to your computer and use it in GitHub Desktop.
Save symisc/1b76bc13d249da453c4d0ed33f31c018 to your computer and use it in GitHub Desktop.
Convert PDF Document to image format using the PixLab PDFTOIMG SDK-Free REST API Endpoint - https://pixlab.io/endpoints/pdftoimg
// Convert PDF Document to image format using the PixLab PDFTOIMG SDK-Free REST API Endpoint
fetch('https://api.pixlab.io/pdftoimg?src=https://www.getharvest.com/downloads/Invoice_Template.pdf&export=jpeg&key=PIXLAB_API_KEY')
.then(response => response.json())
.then(reply => {
if (reply.status !== 200) {
console.log(reply.error);
} else {
console.log("Link to the image output (Converted PDF page): " + reply.link);
}
})
.catch(error => console.error('Error:', error));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment