Skip to main content

pdfsift

PDF → structured Markdown, built for LLM agents. Headings, paragraphs, lists and tables in reading order, with running headers, footers and line-end hyphens removed. Plain heuristics over what the PDF already contains: no AI model, no OCR, no network.

Status: alpha (0.1.0, 2026-11-29). Text, headings, lists and simple tables work well on the test corpus. Images are not exported yet (see Limitations).

$ pdfsift chrome.pdf          # two-column test document (in Portuguese)
<!-- pdfsift: source=chrome.pdf pages=1-3/3 -->
<!-- page: 1 -->
# Colunas Estreitas, Hifenização e Ligaduras

Projeto pdfsift

Resumo

Este documento é composto em duas colunas estreitas para forçar a hifenização no fim das linhas, …

# Introdução

A extração de texto de um arquivo PDF parece simples até o primeiro documento em duas colunas. …

Install

Every channel ships the PDFium library (the PDF engine of Chrome) next to the executable; nothing is downloaded at run time.

Channel Command
npm (no install) npx @vitorsilverio/pdfsift file.pdf
npm (global) npm install -g @vitorsilverio/pdfsift, then pdfsift file.pdf
PyPI (no install) uvx pdfsift file.pdf or pipx run pdfsift file.pdf
PyPI (global) uv tool install pdfsift or pipx install pdfsift
Homebrew brew install vitorsilverio/tap/pdfsift
Shell (Linux, macOS) curl -LsSf https://github.com/vitorsilverio/pdfsift/releases/latest/download/install.sh | sh
PowerShell (Windows) irm https://github.com/vitorsilverio/pdfsift/releases/latest/download/install.ps1 | iex
Archives .tar.xz/.zip with SHA-256 and build attestations on GitHub Releases
Cargo cargo install pdfsift, then get PDFium (below)

Prebuilt for Linux (x86_64, aarch64; glibc 2.34+ for the archives, 2.17+ for the PyPI wheels), macOS (x86_64, arm64) and Windows (x86_64, arm64). No musl/Alpine build yet. On npm the package is scoped (@vitorsilverio/pdfsift, because the registry rejects the unscoped name as too close to pdfkit); the installed command is still pdfsift.

PDFium with cargo install: crates.io carries only the source, so download pdfium-<platform>.tgz from bblanchon/pdfium-binaries chromium/8179 and put the library (libpdfium.so, libpdfium.dylib or pdfium.dll) next to the pdfsift executable, or point PDFSIFT_PDFIUM at it. If it is missing, pdfsift says where it looked.

Usage

pdfsift file.pdf                  # Markdown on stdout
pdfsift file.pdf -o file.md       # to a file
pdfsift file.pdf --pages 10-12    # a slice ("3", "2-4", "1,5-7"), to fit a context window
pdfsift file.pdf --no-page-markers
  • <!-- page: N --> marks where each page starts, so an agent can cite pages. A header comment names the source file and the pages converted.
  • Warnings (for example, a page without a text layer) go to stderr; -q silences them.
  • Exit codes: 0 success (maybe with warnings), 1 error, 2 invalid usage.
  • Output is deterministic: the same PDF always gives the same Markdown.

What it does

  • Reading order: columns are read one after the other; a paragraph that continues in the next column or page is joined back.
  • Hyphenation: words split at line ends are rejoined (interopera- / bility → interoperability), while real hyphens stay.
  • Page furniture: running headers, footers and page numbers are dropped.
  • Headings: from the PDF outline, the structure tags, or the typography (size and weight), with the right level.
  • Lists: bullets, numbers and letters, nested.
  • Tables: a table whose grid is certain becomes a GFM pipe table, with column alignment; merged cells or an uncertain grid give a fenced code block with the text laid out by position, so nothing is invented. On the test corpus (five producers): every cell right in the simple tables, except one table split across a page break, and no prose mistaken for a table.

Compared with pdftotext

The two-column test document above (15 paragraphs), typeset from the same source by Chrome, LibreOffice, LaTeX and Typst; pdftotext is Xpdf 4.00. "Whole paragraphs" counts source paragraphs that come out as one intact paragraph; "split words" counts line-end hyphens left in the text.

Producer pdftotext pdftotext -layout pdfsift
Chrome 9/15 whole, 2 split words 0/15, 2 15/15, 0
LibreOffice 6/15, 3 0/15, 56 15/15, 0
LaTeX 0/15, 29 0/15, 35 13/15, 0
Typst 0/15, 1 (+ soft hyphens left as spaces) 0/15, 23 15/15, 0

Beyond the counts:

  • On LaTeX, plain pdftotext interleaves the two columns line by line; -layout puts them side by side on the same line. pdfsift reads column 1, then column 2.
  • pdftotext keeps Chrome's header and footer (date, title, file:///…, 1/3) on every page; pdfsift removes them.
  • pdftotext has no headings (they are plain lines) and drops Chrome's list markers, gluing items together. pdfsift emits #/##/### at the right level and nested lists.
  • Size is similar: on a 6-page arXiv paper, 40.2k characters for pdfsift and 40.8k for pdftotext (53.1k with -layout). Markdown syntax costs about what removing the furniture saves.
  • Tables: pdftotext flattens them into lines; -layout keeps the alignment but, in two of the test tables (LibreOffice, and a Word-made arXiv paper), shifts values into the wrong row. pdfsift gets both right as GFM tables.

Methodology and per-document results (in Portuguese): text, tables.

Limitations

  • Tables with merged cells come out as a laid-out code block, not a grid; a table split across pages comes out in two parts.
  • Images are not exported yet, and there is no OCR: scanned pages without a text layer are reported on stderr.
  • No emphasis, links or footnote handling yet; footnotes appear as paragraphs at the end of the page.
  • Encrypted PDFs are not supported.
  • The output format may still change before 1.0.

Safety

  • No network access, ever. pdfsift reads the input PDF and writes only to stdout or the -o path.
  • Parsing is done by PDFium, the engine Chrome uses on untrusted web content; pdfsift's own code is written to skip or reject malformed data rather than crash (fuzzing is planned).
  • Release binaries come with SHA-256 checksums and GitHub build attestations (gh attestation verify <file> --repo vitorsilverio/pdfsift).

Development

scripts/fetch-pdfium.sh            # downloads PDFium into .pdfium/ (needs gh)
cargo run -- file.pdf              # convert
cargo run -- dump file.pdf         # inspect what the PDF engine sees
cargo run -- blocks file.pdf       # inspect the layout blocks
scripts/gen-corpus.sh              # regenerate test PDFs (pandoc, lualatex, typst, LibreOffice, Chrome)

PDFium is loaded at run time from PDFSIFT_PDFIUM, next to the executable (or in pdfium/ beside it), from .pdfium/<platform>/ (debug builds only), or from the system library path (not on Windows). The design docs are in docs/ (Portuguese): vision, usage, architecture, distribution, roadmap, decisions.

License

Licensed under either of Apache License 2.0 or MIT license, at your option. The binaries also contain PDFium and its dependencies under their own permissive licenses; see THIRD_PARTY_LICENSES.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Metadata

Release files for pdfsift 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pdfsift 0.1.1
File Actions
pdfsift-0.1.1-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details for pdfsift-0.1.1-py3-none-win_arm64.whl
pdfsift-0.1.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for pdfsift-0.1.1-py3-none-win_amd64.whl
pdfsift-0.1.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for pdfsift-0.1.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
pdfsift-0.1.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for pdfsift-0.1.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
pdfsift-0.1.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for pdfsift-0.1.1-py3-none-macosx_11_0_arm64.whl
pdfsift-0.1.1-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for pdfsift-0.1.1-py3-none-macosx_10_12_x86_64.whl

Total release size: 30.1 MB

Release files / pdfsift-0.1.1-py3-none-win_arm64.whl

Download URL pdfsift-0.1.1-py3-none-win_arm64.whl
Size 4.7 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
a23d801e4f4b125ea3148f2dcfe535cdbc89e9fde1bc44ad14e563d10ad3e907
BLAKE2b-256 checksum
How to use checksums
ccd0d51703dd92ce45aabff88037ff9514436a66db455cadfaed09a7c49e545e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / pdfsift-0.1.1-py3-none-win_amd64.whl

Download URL pdfsift-0.1.1-py3-none-win_amd64.whl
Size 5.0 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
b933c0332edfe8f8bbb9f019b2a5e8bad9f7e78b5e8f7453df3be62f8ad08a4d
BLAKE2b-256 checksum
How to use checksums
3e23d852417e5fddd2fab7a08cd51f272df7f6d1edc62dc619a77411492c112b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / pdfsift-0.1.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL pdfsift-0.1.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 5.3 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
86c710994054873d57ed011c0e48ffcdd4d8cabb6c2c74e5506b94145c5defda
BLAKE2b-256 checksum
How to use checksums
96d30054e23c10777f792cbdbd2ed02af4ec114ceac2913fda813052c885eccc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / pdfsift-0.1.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL pdfsift-0.1.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 5.2 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
2b88b6fe690edbbe3334a72bd341b2708438f41f3364133652c13d62bb630e7c
BLAKE2b-256 checksum
How to use checksums
c9284f8e933904da518b315a0c69f08abb9c9c5a3a4c2216abd5a2cde5e9b9fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / pdfsift-0.1.1-py3-none-macosx_11_0_arm64.whl

Download URL pdfsift-0.1.1-py3-none-macosx_11_0_arm64.whl
Size 4.8 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
920ea67edc543b20811b5931b2f9d59ea6ec41c4d91432101bb01a124c90dd50
BLAKE2b-256 checksum
How to use checksums
838e98b0f38309e9bbc26808102668131f22ec2226146be9c731baafd9ee2da9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / pdfsift-0.1.1-py3-none-macosx_10_12_x86_64.whl

Download URL pdfsift-0.1.1-py3-none-macosx_10_12_x86_64.whl
Size 5.1 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
2b793229f90ee4207d471695e02e301c928b03ac3bdd689749a86d4624a29da6
BLAKE2b-256 checksum
How to use checksums
c88bd80ff8579dcb330a017182527ed25b529b44fa14af7691ed0b51b333bef7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for pdfsift 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for pdfsift-0.1.1-py3-none-win_arm64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page