Skip to main content

MarkItDown with PDF page separators - convert PDFs to Markdown with page boundary markers

Project description

MarkItDown with PDF Page Separators

[!IMPORTANT] MarkItDown with PDF Page Separators is a Python package and command-line utility for converting various files to Markdown, with the addition of PDF page separator functionality.

This is a fork of the original MarkItDown project by Microsoft, adding PDF page separator support.

🆕 New Feature

PDF Page Separators

Convert PDFs to Markdown with clear page boundaries using the add_page_separators parameter:

from markitdown import MarkItDown

md = MarkItDown(enable_plugins=False)

# With page separators (new feature!)
result = md.convert("document.pdf", add_page_separators=True)
# Output includes "---" between pages

# Without page separators (default behavior)
result = md.convert("document.pdf", add_page_separators=False)
# Output is continuous text

Installation

From PyPI:

pip install markitdown-pdf-separators[all]

From source:

git clone https://github.com/yourusername/markitdown-pdf-separators.git
cd markitdown-pdf-separators
pip install -e .

Usage

Command-Line

# Basic conversion
markitdown path-to-file.pdf > document.md

# With page separators (if supported by your version)
markitdown path-to-file.pdf --add-page-separators > document.md

Python API

from markitdown import MarkItDown

# Initialize
md = MarkItDown(enable_plugins=False)

# Convert various file types
result = md.convert("test.xlsx")
print(result.markdown)

# Convert PDF with page separators
result = md.convert("document.pdf", add_page_separators=True)
print(result.markdown)

Supported File Types

  • PDF (with page separators) ✨
  • Word documents (.docx)
  • Excel spreadsheets (.xlsx, .xls)
  • PowerPoint presentations (.pptx)
  • HTML files
  • Plain text files
  • Images (with OCR)
  • Audio files (with transcription)
  • And many more...

PDF Page Separators Feature

What it does:

  • Extracts text page by page from PDFs
  • Adds --- (Markdown horizontal rule) between pages
  • Maintains document structure and readability
  • Works with multi-page documents

Performance:

  • Optimized for efficiency with large PDFs
  • Minimal overhead compared to standard conversion
  • Memory-efficient processing

Example Output:

Page 1 content here...

---

Page 2 content here...

---

Page 3 content here...

Development

This project is based on the original MarkItDown by Microsoft, with added PDF page separator functionality.

Key Changes:

  • Added PDF page separator support
  • Optimized performance for large documents
  • Backward-compatible API

License

MIT License - see LICENSE file for details.

Acknowledgments

  • Original MarkItDown project by Microsoft
  • Based on work by Adam Fourney and contributors

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

markitdown_pdf_separators-0.2.0.tar.gz (41.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

markitdown_pdf_separators-0.2.0-py3-none-any.whl (59.6 kB view details)

Uploaded Python 3

File details

Details for the file markitdown_pdf_separators-0.2.0.tar.gz.

File metadata

File hashes

Hashes for markitdown_pdf_separators-0.2.0.tar.gz
Algorithm Hash digest
SHA256 14973a11540335c6a64e84d700b658d3609df74c7a1abc4b6c4595ddd8269a0d
MD5 c627636cd79fb7e4d076b628f76d4b12
BLAKE2b-256 af5149d2b88663cdb9878a6b933c4045a4f6ed4ddf50d002e0f67b7de902baba

See more details on using hashes here.

File details

Details for the file markitdown_pdf_separators-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for markitdown_pdf_separators-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6bad7d702c44b1f26fa9dba6266e59119bba3a200dc9f64ae21f65b28a5727bb
MD5 6a03e96bd3195b99fce5580866df9fdc
BLAKE2b-256 4944f628f969793438e59496d7b55416bb8d39ec70c91e624e004d80d0f55b8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page