Skip to content

PDF To Images

Type: pdf-to-images  ·  Package: PDF Activities v1.1.0  ·  Output: List

Renders the pages of a PDF to PNG files. It is the bridge between a scanned PDF (one with no selectable text) and the activities that work on images: OCR and the vision ones.

It renders each requested page to a PNG inside outputDir (created if it does not exist) and returns the list of paths of the created files, in page order.

Files are named <prefix>_<page>.png with the page number padded to three digits — for example invoice_001.png, invoice_002.png. If you do not set prefix, the source PDF filename without extension is used.

The dpi decides the render quality: higher DPI improves OCR accuracy, at the cost of speed and file size. The default is 200, which is usually a good balance for documents.

ParameterEditorDescription
pathexpressionPath to the source PDF.
outputDirexpressionDirectory where the PNG files are saved. Created if it does not exist.
ParameterEditorDescription
pagesexpressionPages to render: "all" (default) or a range such as "1-3,5,7-9".
dpiexpressionRender resolution. Default 200. Between 36 and 1200.
prefixexpressionFilename prefix for the output files. Defaults to the PDF filename without extension.

Returns a List with the paths of the created PNG files, one per rendered page.

Read a scanned PDF by running OCR page by page:

PDF To Images path = = scanPath outputDir = "C:/temp/pages" dpi = 300 → output: images
For Each collection = = images itemVariable = image
└─ activities:
OCR Recognize File path = = image language = "eng" → output: text
Log message = = text

Render only the first page:

PDF To Images path = = filePath outputDir = "C:/temp" pages = "1" prefix = "cover" → output: images
  • OCR Recognize File — read the text of the generated images.
  • PDF Get Words — if the PDF does have text, get the words with coordinates that line up with these images at the same DPI.
  • PDF Get Text — extract text without going through images.