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, not released yet). 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

Coming with 0.1.0. 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 pdfsift file.pdf
PyPI (no install) uvx pdfsift file.pdf or pipx run pdfsift file.pdf
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.

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.0

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.0
File Actions
pdfsift-0.1.0-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details for pdfsift-0.1.0-py3-none-win_arm64.whl
pdfsift-0.1.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for pdfsift-0.1.0-py3-none-win_amd64.whl
pdfsift-0.1.0-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.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
pdfsift-0.1.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for pdfsift-0.1.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
pdfsift-0.1.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for pdfsift-0.1.0-py3-none-macosx_11_0_arm64.whl
pdfsift-0.1.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for pdfsift-0.1.0-py3-none-macosx_10_12_x86_64.whl

Total release size: 30.0 MB

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

Download URL pdfsift-0.1.0-py3-none-win_arm64.whl
Size 4.6 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
6ed10c3ca2ccbb124abccb4afe2a5bf45476f8dea0d681d19850fe30078bbd00
BLAKE2b-256 checksum
How to use checksums
cdb605d5e3d20ef94a8f5b99311c5acb56f7e9e7324935929875d1b7d2b01640
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.0-py3-none-win_amd64.whl

Download URL pdfsift-0.1.0-py3-none-win_amd64.whl
Size 5.0 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
0640c2aa09342e9534c60832ff9411d34dc7c911f474ac67c267201e34333608
BLAKE2b-256 checksum
How to use checksums
0920cc4214246da2d299324af9f6b7e690f2945042740c3104df76be4ca1033c
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.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL pdfsift-0.1.0-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
44d844e91cbb437b1ed7c3bae768be2572fb4ef6312bffad609ed2f88e6d8054
BLAKE2b-256 checksum
How to use checksums
286fe338e6b92032086ae371e5c89b019065762a2eda73cc9d74faa4d73c0edd
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.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL pdfsift-0.1.0-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
c6f852c42516298f46aa10a8e2b0894319867d45a033b148a8d6e5cb608dbf73
BLAKE2b-256 checksum
How to use checksums
ca75f78a599ac823f73ecb7097c38d6a4aef85835a830bbebfc0b6ae7417e397
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.0-py3-none-macosx_11_0_arm64.whl

Download URL pdfsift-0.1.0-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
0d6be0251e8dc82e08cc3e5b25ebad2bc384ca6b2ec9fd4e1fffbf3d24b48d64
BLAKE2b-256 checksum
How to use checksums
5dcef4c438c4cfdf917dce1df57c7965e7586a0a5072435c7ab5677946947ec1
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.0-py3-none-macosx_10_12_x86_64.whl

Download URL pdfsift-0.1.0-py3-none-macosx_10_12_x86_64.whl
Size 5.0 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
d06e37083146fe809a323cdc857850559d9801e04d4a75a040de140d8d6da8f6
BLAKE2b-256 checksum
How to use checksums
3a33b4f3bc888c2dbfcf9cce7b05b50d4ecff09f852ac857d279aef10e47d4a7
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.0

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.0-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