Extract layout-aware content from PDF

Supported in: Batch, Faster

Extracts layout-aware content from PDF pages. Returns structured blocks with bounding boxes, text content, and block types. Supports configurable OCR modes and output formats.

Expression categories: Media

Declared arguments

  • Languages to detect: Languages to detect in the PDF.
    Set<Enum<Afrikaans, Albanian, Amharic, Arabic, Armenian, Assamese, Azerbaijani, Azerbaijani - Cyrilic, Basque, Belarusian, and more ...>>
  • Media reference: The column containing media references to PDF files in a media set.
    Expression<Media reference>
  • Scripts to detect: Scripts to detect in the PDF.
    Set<Enum<Arabic, Armenian, Bengali, Canadian Aboriginal, Cherokee, Cyrillic, Devanagari, Ethiopic, Fraktur, Georgian, and more ...>>
  • optional End page: The end of the page range (inclusive). If no value is provided, it will default to the last page.
    Expression<Integer>
  • optional Error handling: Determines the behavior of the pipeline for inputs that fail to process.
    Enum<FAIL, NULL>
  • optional Extract method: Choose how text is extracted. Conditional scan uses best-effort detection to scan pages with little or no digital text. Digital text extracts embedded digital text. Full-page scan scans every page.
    Enum<Conditional Scan, Digital Text, Full-page Scan>
  • optional Output format: The format of the extracted text content within blocks.
    Enum<HTML, Markdown, Text, hOCR>
  • optional Start page: The start of the page range. If no value is provided, it will default to the first page.
    Expression<Integer>

Output type: Array<Array<Struct<block_index, block_id, page, block_type, content, bounding_box, languages<String>, confidence>>>

Examples

Example 1: Base case

Argument values:

  • Languages to detect: {ENG}
  • Media reference: mediaReference
  • Scripts to detect: {}
  • End page: End Page
  • Error handling: FAIL_FAST
  • Extract method: AUTO
  • Output format: TEXT
  • Start page: Start Page
mediaReferenceOutput
{"mimeType":"application/pdf","reference":{"type":"mediaSetItem","mediaSetItem":{"mediaSetRid":"ri.mio.main.media-set.a", "mediaItemRid":"ri.mio.main.media-item.a"}}}[ [ {
 block_id: block-0,
 block_index: 0,
 block_type: Text,
&... ]