Repository navigation
v1.22.0
Highlights
- Page numbers anywhere.
counter(pages)gives the page count in the content, not only in the page-margin boxes, as in Prince, and-pdfpecker-target-pages()gives the first and last page of a section, how many pages it covers and the page within it, also on elements without an id ({section-page:name}in running headers and footers). - Removing active content.
PdfSanitizer.RemoveActiveContenttakes JavaScript, actions that launch programs, open other files or submit form data, XFA and media annotations out of PDFs from others, andHasActiveContenttells whether a PDF has any. Pages, text, links and form fields stay. - Safer signatures and long-term validation. SHA-1 signatures are no longer
ValidunlessPdfSignatureVerificationOptions.AllowSha1is set (PdfSignatureVerification.UsesSha1says why); verification catches shadow attacks that redirect the cross-reference table after a certification and a dropped/Perms; andFetchRevocationDatafetches OCSP and CRL data only from public addresses unless aUrlFilterallows others. - More CSS: the
gridshorthand, thestretchsizing keyword and-webkit-fill-availablefor widths, heights and their limits,image-set()in backgrounds, list markers and generated content,text-box,text-box-trimandtext-box-edge(lines trimmed to the cap height and baseline, as Chrome trims them),corner-shape(squircle, bevel, scoop, notch andsuperellipse()corners),overflow-clip-margin,rect()andxywh()inclip-pathandshape-outside,text-emphasis,text-indentwithhanging,each-lineand percentages,font-width,:valid,:invalidand:open, borders, padding and background images on the@pagebox, and backgrounds on::first-line. ::markeras in Chrome: a larger marker font or a tall marker image makes its line taller,content: nonehides the marker,counter(list-item)numbers it, and its owndirectionorders its text.- Closer to Chrome: icons drawn with
<use>from a hidden SVG sprite (as in Bootstrap), a forced break before a box's first child breaks before the whole box (so tables of contents point at the right page), images and inline-blocks aligned totext-topandtext-bottom, SVG backgrounds without aviewBoxscaled tobackground-size, flex rows break inside their items at a page's end, quirks-mode line heights, square dots for thin dotted borders, percentage lengths in inline SVG, percentage heights in table cells that span rows, auto margins on floats, the legacy body margin attributes, border-image number widths in standards mode, and a whole shorthand dropped when one part has a unitless length. - Fonts: fonts whose only Unicode cmap is format 10 or 13, such as last-resort fonts, are used by HTML to PDF instead of falling back to Helvetica.
PdfOptions.Clone()copies shared options so one setting can change without touching the others.- PdfPecker.Fluent: page numbers and the page count in the content,
EndPageNumberOfSection,TotalPagesWithinSectionandPageNumberWithinSection, and cell backgrounds and borders that fill the row in any call order. - Hostile input and speed: a total budget for decoded object streams (a 4 MB file could make 9 GB), bounded stream decoding outside a render scope, rasterizer coordinates kept finite, a bounded cache of pattern tiles in the renderer, and fuzzing fixes for JPEG scans, footnote calls, grid items, very tall split table rows and large paginated grids (60,000 grid items lay out in 0.4 s instead of 7.4 s). Text measured with a font-family list allocates about a third of what it did in 1.21.0, and invoices allocate about an eighth less.
Output changes
Golden baselines changed where the output now matches Chrome more closely: square dots for thin dotted borders (features/images, inline-borders/demo), images aligned to text-top (features/images and the PDF-to-HTML pdf-to-html/features-images made from it) and quirks-mode line heights (forms/demo, which has no doctype). Documents without a doctype can have shorter lines of small text and shorter table cells holding only an image; documents with flex rows that cross a page now break inside the row instead of moving it to the next page whole, and a section whose first child has break-before: page now starts on the new page together with its border and background. Eight new golden pages cover the features since 1.17.0; they add baselines and change none.
Verification results change for SHA-1 signatures, which are now reported as not valid; set AllowSha1 to accept them for old archives.
The manual for this version: https://pdfpecker.net/docs/v1.22.0/
Full Changelog: v1.21.0...v1.22.0