Download Latest Version v2.6.7 source code.zip (25.8 MB)
Home / v2.2.0
Name Modified Size InfoDownloads / Week
Parent folder
pdf_craft-2.2.0-py3-none-any.whl 2026-09-09 224.9 kB
pdf_craft-2.2.0-py3-none-any.whl.publish.attestation 2026-09-09 9.5 kB
pdf_craft-2.2.0.tar.gz 2026-09-09 174.5 kB
pdf_craft-2.2.0.tar.gz.publish.attestation 2026-09-09 9.9 kB
README.md 2026-09-09 2.6 kB
v2.2.0 source code.tar.gz 2026-09-09 18.9 MB
v2.2.0 source code.zip 2026-09-09 19.0 MB
Totals: 7 Items   38.3 MB 0

PDF Craft v2.2.0

What's Changed

Paragraph-aware PDF translation

  • Translate and lay out each ParagraphLayout as one continuous text flow across its ordered OCR boxes, including boxes that cross pages. Complete lines move to the next box rather than being split at a box boundary.
  • Add a second, per-page font normalization pass: it keeps the frozen line allocation while bringing each box toward its semantic-level character-weighted average. Headlines remain larger than body text and naturally overflow rightward when their required minimum cannot fit.
  • Resolve an installed local font once per patch run when no family is configured, accept floating-point font sizes, and keep missing configured families as Qt fallback rather than a hard failure.

Independent visual base, erasure, and selectable translation

  • Compile each page's non-Annotation content to a fontless Ghostscript visual base. The source visual appearance remains while source and hidden OCR text no longer interferes with selecting, searching, or extracting the Qt translation text.
  • Preserve the original /Annots array above translation, retaining links, highlights, notes, forms, and other PDF annotations as independent interactive objects.
  • Replace fixed white erasure with padded rectangles filled by a frequency-weighted median RGB color sampled from the original page. EraseOptions controls padding; the basic eraser deliberately does not reconstruct paper texture, rules, formulae, or artwork.

Inline formulas in PDF translation

  • Preserve inline formulas in paragraph XML so formulas remain in translation context while their source expression is retained during write-back.
  • Render inline formulas as vector PDF content by default when Matplotlib and local TeX are available. Missing optional runtime support, or a failed individual formula, falls back to readable plain text without failing the PDF. Formula content and its following visible spacing are one unbreakable layout atom.

Requirements and compatibility

  • PDF patching now documents Ghostscript, Poppler (for local color sampling), and installed local fonts as runtime requirements. Matplotlib plus local TeX is optional and only needed for vector inline formulas; OCR and TeX are not CI dependencies.
  • BoxTextLayout is no longer part of the PDF patching interface. Use QTextParagraphFiller with PatchTextOptions, or the high-level PDFCraft.translate_pdf() / PDFCraft.patch_pdf_with_extraction() APIs instead.

Full Changelog: https://github.com/oomol-lab/pdf-craft/compare/v2.1.0...v2.2.0

Source: README.md, updated 2026-09-09