Link Search Menu Expand Document

How to get PDF dimensions

You can use the PDF Info API to get the document information and page size. For example, the sample code below will return the page size 612 x 792 points.

POST [https://api.pdf.co/v1/pdf/info](https://api.pdf.co/v1/pdf/info) HTTP/1.1
content-type: application/json
x-api-key: YOUR_API_KEY

{
    "url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-info/sample.pdf"
}

The v1/pdf/convert/to/json2 endpoint’s generated JSON also contains width and height for each page. Pages in PDF can be of different sizes.

Applies To:

  • /pdf/convert/to/json2
  • /pdf/info