actpkg.dev
Components

library/pdf-inspector

v0.1.0 Signed

Classify PDFs and extract text and Markdown without OCR

by @library updated 2026-08-12 4.8 MB 0

Install

$ act pull actpkg.dev/library/pdf-inspector

Capabilities

Moderate host access

Requests: Filesystem read-only.

  • wasi:filesystem Filesystem read-only

    ** (ro)

Risk Low Medium High

Tools · 4

act:tools interface — expand a tool for its input schema.

  • to_markdown

    Convert a PDF to Markdown, preserving headings, lists and tables. Returns the detected PDF type alongside the Markdown — check `pages_needing_ocr` and `has_encoding_issues` to know whether the text is trustworthy.

    ParameterTypeDescription
    dataobject | nullInline PDF bytes, as a CBOR byte string — or the canonical `{"$bytes": "<base64>"}` envelope over JSON transports.
    pathstring | nullPath to a PDF file on the host. Requires a `wasi:filesystem` read grant covering this path.
    pagesarray | null1-indexed page numbers to extract. Omit to extract every page.
    profilevariant`fidelity` (default) stays close to the source; `compact` emits fewer tokens.
    passwordstring | nullPassword for an encrypted PDF.
    include_imagesboolean | nullInclude image placeholders in the Markdown.
    include_page_markersboolean | nullInsert `<!-- Page N -->` markers between pages.

    Returns content.

  • detect

    Detect whether a PDF is text-based or scanned, with page count, title and layout complexity. Does not extract text, so it is much cheaper than to_markdown.

    ParameterTypeDescription
    dataobject | nullInline PDF bytes, as a CBOR byte string — or the canonical `{"$bytes": "<base64>"}` envelope over JSON transports.
    pathstring | nullPath to a PDF file on the host. Requires a `wasi:filesystem` read grant covering this path.
    passwordstring | nullPassword for an encrypted PDF.

    Returns content.

  • classify

    Cheaply classify a PDF (typically 10-50ms): type, page count, which pages need OCR, and confidence. Call this before to_markdown to avoid spending tokens on a scanned document.

    ParameterTypeDescription
    dataobject | nullInline PDF bytes, as a CBOR byte string — or the canonical `{"$bytes": "<base64>"}` envelope over JSON transports.
    pathstring | nullPath to a PDF file on the host. Requires a `wasi:filesystem` read grant covering this path.

    Returns content.

  • extract_text

    Extract plain text from a PDF with no Markdown formatting, one line per detected text line.

    ParameterTypeDescription
    dataobject | nullInline PDF bytes, as a CBOR byte string — or the canonical `{"$bytes": "<base64>"}` envelope over JSON transports.
    pathstring | nullPath to a PDF file on the host. Requires a `wasi:filesystem` read grant covering this path.

    Returns content.

Readme

No README provided.