pdftract/tests/fixtures/vector/code-documentation/ground_truth.txt
jedarden fe59fa9785 feat(pdftract-47e42): implement URL fragment routing for shareable links
- Add #page=N URL fragment routing for shareable inspector links
- Support browser back/forward navigation via hashchange event
- Persist overlay toggle state in localStorage with error handling
- Add isUpdatingFragment flag to prevent double-render on hash updates
- Update thumbnail click handler to rely on updateFragment()
- Clamp out-of-range page numbers with console warnings
- Default to page 0 for invalid/non-numeric page numbers
- Add vector fixture provenance entries

Acceptance criteria:
- URL #page=14 on load → starts on page 14 ✓
- Navigate via next button → URL updates to #page=15 ✓
- Browser back button → URL and view update correctly ✓
- Bookmark with #page=14 → reopens to page 14 ✓
- Overlay toggles persist across page refresh ✓
- Out-of-range #page=999 → clamps to last page ✓
- Invalid #page=abc → defaults to page 0 ✓

Closes pdftract-47e42

Verification: notes/pdftract-47e42.md
2026-06-01 08:23:59 -04:00

23 lines
No EOL
607 B
Text

libpdf - PDF Processing Library
Installation
pip install libpdf
Quick Example
from libpdf import Document
doc = Document('example.pdf')
text = doc.extract_text()
API Reference
Document.open(path)
Opens a PDF file for reading.
Document.extract_text()
Extracts all text content from the document.
Document.get_page_count()
Returns the number of pages in the document.
Supported Formats
PDF 1.0 through PDF 2.0
Encrypted PDFs (with password)
Forms and annotations
Limitations
OCR requires additional dependencies.
Very large files may require streaming mode.
License
MIT License - see LICENSE file for details.