Skip to content

Command Line Options

This page groups the CLI flags by task. Run pdfvision --help for the exact help text installed in your current version.

Input

OptionPurpose
<file.pdf>Read a local PDF file.
--remote <url>Download an HTTP(S) PDF, validate the PDF header, then extract it. Cached unless --no-cache is also passed.
-p, --pages <range>Extract pages such as 1, 1-5, 1,3,5, or 2-4,7. Default: all pages.
--password <value>Open an encrypted PDF with a password. The password is not emitted in output.
--password-stdinRead the encrypted PDF password from piped stdin. Falls back to --password if stdin is empty.

Output Format

OptionPurpose
-f, --format <type>Output markdown, json, xml, or toon. Default: markdown.
--markdownShortcut for --format markdown.
--jsonShortcut for --format json.
--xmlShortcut for --format xml.
--toonShortcut for --format toon.
--no-normalizeDisable Unicode NFKC normalization. With normalization enabled, JSON and XML preserve changed pre-normalization text in rawText.

Format shortcuts are intentionally strict. Passing two different shortcuts, or a shortcut that conflicts with --format, is an error.

Rendering

OptionPurpose
-r, --renderRender each selected page as a PNG and attach the image path to the page result.
--render-output <dir>Write rendered page PNGs or visual-region PNGs into a directory. Requires --render or --render-visual-regions.
--render-scale <n>Set rasterization scale for --render, --render-visual-regions, or --ocr. Default: 2; accepts decimals in (0, 4].
--render-region <x,y,width,height>Render one page sub-rectangle in PDF points. Requires --render or --ocr, and --pages must resolve to exactly one page.

Coordinates use a top-left origin: x grows right, y grows downward. The same coordinate system is used by layout blocks, image boxes, vector boxes, search matches, and visual regions.

Layout and Visual Structure

OptionPurpose
--geometryEmit per-text-item bounding boxes and font size in pages[].spans. Structured formats only.
--layoutReconstruct lines, blocks, vertical CJK stacks, numeric-table hints, Markdown layout order, and layout warnings.
--image-boxesEmit raster image bounding boxes in pages[].imageBoxes.
--vector-boxesEmit vector drawing boxes in pages[].vectorBoxes.
--visual-regionsEmit crop-ready regions for figures, charts, diagrams, tables, forms, annotations, and raster/vector clusters.
--render-visual-regionsRender visual-region crops and attach crop paths, content ratios, and tighter rendered content boxes. Implies --visual-regions.
--strip-repeatedRemove repeated headers, footers, and page-number blocks from Markdown output. Requires --layout; Markdown only.
OptionPurpose
--search <query>Find occurrences and emit pages[].matches[] with page, source, text, query, and bbox evidence. Repeatable.
--search-regexTreat each --search value as a JavaScript regular expression.
--search-case-sensitiveMatch case exactly. Default search is case-insensitive.

Search is NFKC-aware by default and can match native text, form-field text, visible FreeText annotations, and OCR text when --ocr is enabled.

PDF Features

OptionPurpose
--form-fieldsEmit widget fields, flags, actions, export values, choices, values, bboxes, and nearby visible labels. Markdown also renders a form-field table.
--linksEmit link annotations with bboxes, URLs, named destinations, and resolved destination pages when available. Markdown also renders a links table.
--annotationsEmit non-link annotations such as comments, highlights, stamps, file attachments, shapes, and ink.
--structureEmit tagged-PDF structure trees when the PDF provides them.
--page-labelsEmit viewer page labels in pageLabels and pages[].pageLabel.
--attachmentsEmit embedded file attachment metadata without embedding file bytes in the structured output.
--attachment-output <dir>Write embedded attachment files to disk. Requires --attachments.
--outlineEmit document outline/bookmarks, preserving hierarchy, URLs, actions, and resolved destinations when possible.
--viewerEmit viewer settings, open actions, JavaScript actions, permissions, and MarkInfo.
--layersEmit optional content groups, visibility states, radio groups, and viewer panel order.

OCR

OptionPurpose
--ocrRun Tesseract OCR and attach pages[].ocr with text, confidence, language, and word boxes.
--ocr-lang <lang>Set OCR languages, such as eng, jpn, or eng+jpn. Default: eng.

OCR never replaces pages[].text; it is added beside the native text so the agent can compare both signals.

Cache and Help

OptionPurpose
--no-cacheSkip the on-disk extraction cache. With --remote, stream the downloaded PDF directly without writing the remote-PDF cache.
--clear-cacheWipe cached extractions, rendered PNGs, and remote downloads, then exit.
-v, --versionPrint the pdfvision version.
-h, --helpPrint CLI help.

Exit Codes

CodeMeaning
0Success.
1Argument error, file not found, network error, or extraction failure. The error message is printed to stderr.

Released under the MIT License.