Skip to main content

Convert PDF to Image


Easily convert PDFs to images using The DynamicPDF API's pdf-image endpoint.

Convert PDFs to images using the pdf-image endpoint. Call the pdf-image endpoint directly or use one of our client libraries.

tip

Check out Getting Started and Task Roadmap if you are new to The DynamicPDF API.

Calling Endpoint Directly

Call the pdf-image endpoint directly using a tool such as cURL or Postman. You can convert one or more pages of a PDF to one or more images using this endpoint. If a single page from a PDF is rasterized then the endpoint returns a single image as binary. If multiple pages from a PDF are rasterized then the endpoint returns a JSON document, where each image is a base64 encoded string.

info

Refer to the documentation for complete information on the pdf-image endpoint.

Single Page PDF

The following examples illustrate converting a PDF to an image. In the first example it converts a single page PDF to an image. In the second example it converts only the second page from a multi-page PDF.

curl https://api.dpdf.io/v1.0/pdf-image 
-H"Authorization:Bearer DP--api-key--"
-F "pdf=@C:/temp/dynamicpdf-api-samples/pdf-image/onepage.pdf"
-o simple-image.png

Run In Postman

curl "https://api.dpdf.io/v1.0/pdf-image?sp=2&pc=1" 
-H"Authorization:Bearer DP--api-key--"
-F "pdf=@C:/temp/dynamicpdf-api-samples/pdf-image/multipage.pdf"
-o simple-image.png

Multi-Page PDF

The following example illustrates converting a multi-page PDF to an image.

curl https://api.dpdf.io/v1.0/pdf-image 
-H"Authorization:Bearer DP--api-key--"
-F "pdf=@C:/temp/dynamicpdf-api-samples/pdf-image/multipage.pdf"
-o images.json

Calling Endpoint Using Client Library

Easily convert a PDF to an image using the xxxx class or its equivalent using the C#, Java, Node.js, PHP, Go, or Python.

info

Refer to the documentation for complete information on the pdf-image endpoint.

Single Page PDF

The following two examples illustrate creating images from PDFs. In the first example it converts a single page PDF to an image while the second example creates an image by only extracting a single page of a multi-page PDF.

TBD
TBD

Multi-Page PDF

TBD
   Follow us on social media for latest news!