pdfto
Convert PDF files to Markdown or plain text from the command line.
Install
pip install pdfto
Usage
# Convert to Markdown (output alongside input)
pdfto --markdown example.pdf
# Convert to Markdown with explicit output path
pdfto --markdown example.pdf -o output.md
# Convert to plain text
pdfto --text example.pdf -o output.txt
# Write to stdout
pdfto --markdown example.pdf -o -
# Batch: multiple files
pdfto --markdown a.pdf b.pdf -o ./converted/
# Batch: entire directory (recursive)
pdfto --markdown ./docs/ -o ./out/
Options
| Flag | Description |
|---|---|
--markdown |
Convert to Markdown (.md) |
--text |
Convert to plain text (.txt) |
-o / --output |
Output file, directory, or - for stdout |
--force |
Overwrite existing output files |
--quiet |
Suppress progress messages |
--version |
Show version and exit |
How it works
Uses PyMuPDF to extract per-span font metadata (size, bold, italic, monospace flags). Heading levels are assigned by font-size ratio relative to the document's body text size. No ML or GPU required.
Metadata
Release files for pdfto 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pdfto-0.1.0.tar.gz | 4.2 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pdfto-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.2 MB
Release files / pdfto-0.1.0.tar.gz
| Download URL | pdfto-0.1.0.tar.gz |
|---|---|
| Size | 4.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
91091cb16046f98f43af8015e278cf2cd1c7f5018a4c38d7ef1ab337587ba936
|
|
BLAKE2b-256 checksum How to use checksums |
f8d7843b14e9e33b6bb6b9af09f3f09c5d0e32ca1cc47a84dbb75fe5ec8e950a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 25, 2026.
Transparency logRelease files / pdfto-0.1.0-py3-none-any.whl
| Download URL | pdfto-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
405bc8af48873b57a1049eb84270d18a9bbd1789ceddccae45fb5ed175a8a4ff
|
|
BLAKE2b-256 checksum How to use checksums |
0d97f30870fae99d94bba2f028e5e6f02238119788cdff784cc0cac26a2b4de0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 25, 2026.
Transparency log