Skip to content

v1.6.0

Choose a tag to compare

@github-actions github-actions released this 23 Oct 23:44
· 137 commits to main since this release

Highlights

  • True redaction: text, paths, images, annotations and metadata under given areas are removed from the file, not covered.
  • Reading order on multi-column pages: the reading-order error on the real-world multi-column category drops from 16.8 % to 7.6 % (PdfPig, best of its pipelines: 16.8 %); overall from 15.2 % to 14.0 %.

Added

  • True redaction. PdfDocument.Redact removes glyphs, vector paths, shadings and image samples inside given areas by rewriting page, form and annotation-appearance content (remaining glyphs keep their places), blanks and re-encodes images as Flate, removes or redacts annotations and form values under the areas, strips alternate text and structure text of the removed content, and clears metadata (Info, XMP, outline titles) that matches given terms. ApplyRedactAnnotations applies the /Redact annotations in a file. A page that cannot be read completely fails the call with PdfRedactionException and leaves the document unchanged. A redact fuzz target covers it. See docs/redaction.md.
  • PdfSoftMaskInfo.TransferTable: the soft mask's /TR transfer function (ISO 32000-2 11.6.5.2) evaluated by OnePDF into 256 bytes (entry i is the output for i / 255, rounded half up and clamped), null for no /TR or /Identity. Function types 0, 2, 3 and 4 are supported; an unusable function is ignored with a warning. The display-list text format is version 6: begin-softmask gains trtable=.

Changed

  • Documented that viewers disagree on whether /NeedAppearances regenerates check box, radio button and push button art, and pinned OnePDF's behaviour (stored art is kept) with a test. No behaviour change.

Fixed

  • Reading order: columns whose paragraph gaps fall at the same heights are no longer read band by band when something spanning both columns (a full-width note or caption) stops the vertical cut. The horizontal cut now keeps successive bands together when each holds multi-line columns and they share a gutter, and the columns are cut apart afterwards. On the committed and local real-world set the reading-order error is 13.8 % overall (was 15.2 %): multi-column 7.6 % (was 16.8 %), table 0.6 % (3.0 %), form 4.2 % (6.5 %), rotated 9.3 % (12.2 %); math moves from 11.9 % to 12.5 %. The generated set is unchanged. See docs/text-layout.md.
  • Editable documents: a new object never takes the number of a reference that points at an undefined object, so a dangling reference no longer starts to resolve to unrelated content added later.
  • Encrypted files: the /Contents string of a signature dictionary (/Type /Sig or /DocTimeStamp, or any dictionary with /ByteRange) is no longer decrypted on read (ISO 32000-2 7.6.2), so the raw bytes, PdfSignature.Contents and a full save of a signed encrypted file all carry the stored signature.
  • CFF subsets (CID-keyed) write the leading ROS operands of the Top DICT in their shortest integer form, which strict readers need to recognise the Top DICT as CID-keyed (veraPDF warned "The Top DICT does not begin with ROS operator").
  • The TrueType subsetter can write a (3,1) format 4 cmap, and PDF/A production now subsets the Liberation faces it embeds for standard fonts (the four-font test file went from 834 KB to 112 KB) instead of embedding them whole.