Home Search

DriveWorks Pro 22
PDFGetImageDetails

Send Feedback

PDFGetImageDetails

This function returns information about the images inside a given PDF document. The result is returned as a table array.

Syntax

PDFGetImageDetails([PDF File])

Where:

PDF File is the path to the PDF file from which to get the info. If a full file path is not given the path will be resolved to the Project location unless one of the following prefixes is used:

  • <Project>
  • <Specification>
  • <SpecificationMetaData>
  • <GroupContent>

Examples

Rule

Result
PDFGetImageDetails("C:\DriveWorks\Document.pdf")This will return a table with all the image data in the PDF file called "Document.pdf".

The table will contain nine columns: PageNumber, ImageIndex, Height, Width, UpperRightX, UpperRightY, LowerLeftX and LowerLeftY.

The returned array will be ordered by PageIndex, and then ImageIndex in ascending order.

Example Data

The following is an example of the PDF file used to extract the image details.

PDFGetImageDetailsPDFExample

Image showing an eample PDF file with images to extract the details from.

Example Outcome

PageNumberImageIndexHeightWidthUpperRightXUpperRightYLowerLeftXLowerLeftY
118585566.9809.02481.9724.02
12177.6355.2475.1309.78119.9132.18
13225450522.65641.7272.65416.72
21225450522.65641.1272.65416.12
228585566.9811.02481.9726.02

Results are sorted on ascending PageNumber and PageIndex, you can use other table functions to perform any other sorting you need.

About the Details Obtained

Image Position is measured from the bottom left of each page in DPI.

Image Height and Width are in DPI.

DPI = dots per inch.

For each image, the following data will be returned:

  • Page Number – the page number the image is on.
  • Image Index – the index of the image. Each image has a unique index on each page.
  • Height- the height of the image in DPI.
  • Width – the width of the image in DPI.
  • Upper Right X – the horizontal X distance between the image's upper right point to the page's lower left corner in DPI
  • Upper Right Y – the vertical Y distance between the image's upper right point to the page's lower left corner in DPI
  • Lower Left X – the horizontal X distance between the image's lower left point to the page's lower left corner in DPI
  • Lower Left Y – the vertical Y distance between the image's lower left point to the page's lower left corner in DPI

The image below explains where each coordinate is taken from.

Image showing the coordinates obtained from an image.