Repository navigation
Changes
- Fillable PDF forms now stay fillable under the default
--output-type auto.
PDF/A conversion removes form fields, so for an input with an interactive
form (/AcroForm),autonow outputs a regular PDF instead of PDF/A,
unless a force mode is flattening the form on purpose. An explicit
--output-type pdfastill produces PDF/A, with what the fields display
drawn on the page, and now warns that the form was removed. {issue}1790
Thanks @mvanhorn. --pagesnow warns when it names pages beyond the end of the input file,
and stops with an error if none of the pages it names exist. Previously
such pages were ignored silently, and a run that processed no pages at all
still succeeded. Thanks @RavSinghChandan.- Plugins can now change the image the RapidOCR engine reads, by subclassing
its engine and overridingdetection_image. RapidOCR then detects and
recognizes text in the prepared copy of each page, while text lines are
still fitted to the original. The newocrmypdf.rapidocrpackage offers a
small public interface for reading page images with RapidOCR. See
{ref}rapidocr-plugins.
Fixes
- Fixed RapidOCR losing text on dense pages. RapidOCR kept at most 1,000
text regions per page and found them from the bottom of the page up, so
the top of a dense table, often its header rows, was silently dropped. - Fixed the RapidOCR text layer on tables. Each cell was sized and sloped
from its own detection box, so cells on one row came out at different
sizes and slants, short cells were tilted by several degrees, and tall
cells reached into the next row; text extraction tools then merged rows or
read them out of order. The cells of a row now share one size, baseline
and slope, fitted to the row's ink, and no cell reaches into the row below.
The blurred edges of scanned table rules no longer count as a cell's ink,
and a single character is no longer mistaken for vertical text. - Fixed form fields missing from pages rasterized with pypdfium2, the default
rasterizer. In particular,--force-ocrerased the contents of filled
forms instead of flattening them. - Fixed pypdfium2 rasterizing the wrong part of a page whose CropBox is
smaller than its MediaBox in only one dimension. With--force-ocr, the
visible part of such a page could be replaced by content from outside it,
or left blank. - Fixed PDF/A conversion and
--rasterizer ghostscriptshowing missing or
outdated values for text and choice fields, in forms that ask viewers to
redraw their fields (NeedAppearances). A warning is issued if a field
cannot be redrawn. - Fixed internal links being disabled when their destination is an explicit
page reference rather than a named destination. Such links were wrongly
treated as pointing to a missing named destination. Thanks @bbmedia. - Importing
ocrmypdfno longer modifies pdfminer.six or fpdf2. Previously,
other users of pdfminer.six in the same process could not extract text in
fonts with neither an/Encodingnor a/ToUnicode, such as plain
/Helvetica, once OCRmyPDF had been imported. The fpdf2 patch is no longer
needed as of fpdf2 2.9.0. - Fixed
--redo-ocroverlooking existing text in standard fonts, including
Symbol and ZapfDingbats, that do not declare an encoding. - Fixed
--redo-ocralways failing when using worker processes, for files
with enough pages to need more than one worker. - Errors while examining pages for
--redo-ocrare now reported, instead of
an unrelatedAttributeError. - Removed a workaround for Type 3 fonts in PDFs created by PScript5.dll. Current
versions of pdfminer.six do not need it, and it could misplace text. - Fixed
--sidecar -being rejected when the input file is also-. The
input is read from standard input and the sidecar written to standard
output, so they do not collide. {issue}1791Thanks @tubist2004.
Other
- Release process improvements: release sdists now carry the release
commit's date as their file timestamps, instead of a fixed date in 2020.
{issue}1789Thanks @mahmoudsegni.