The PixLab team is pleased to introduce the PDF to Image API endpoint which let you convert any PDF file to a high resolution JPEG/PNG image format.
the /pdftoimg endpoint documentation is available to consult here and below a working Python code sample:
import requests
import json
# Convert a PDF document to JPEG/PNG image via /pdftoimg endpoint.
req = requests.get('https://api.pixlab.io/pdftoimg',params={
'src':'https://www.getharvest.com/downloads/Invoice_Template.pdf',
'export': 'jpeg',
'key':'My_PixLab_Key'
})
reply = req.json()
if reply['status'] != 200:
print (reply['error'])
else:
print ("Link to the image output (Converted PDF page): "+ reply['link'])
You can visit the PixLab Github repository for additional code samples in various programming languages.