Repository navigation
v1.24.0
Highlights
- Text extraction in reading order.
PdfTextnow reads a tagged PDF in the order of its structure tree, and columns, boxes and text set side by side one after the other instead of across the page line by line. It also reads columns of unequal length, right-to-left columns from the right, pages turned with/Rotate, vertical CJK writing drawn letter by letter, skewed scans, Arabic words joined by cursive attachment, and numbers in Hebrew and Arabic lines with their separators and signs.PdfTextOptions.Order = PdfTextOrder.TopToBottomgives the 1.23.0 order back. Thai, Indic and Arabic text now copies and extracts as the letters written in PdfPecker's PDFs (Poppler, MuPDF and PdfText alike), also on SVG text paths. - Faster text, Markdown and structured HTML from PDFs. Text extraction,
PdfToMarkdownand structuredPdfToHtmlallocate about half as much and run 44 to 57% faster than before the speed work; the 30-page report extracts 27% faster than in 1.23.0 even in reading order. Tables whose cells draw their own borders (the CSS default) are now found as tables. - PDF redaction.
PdfRedactor.RedactandRedactTexttake text, image pixels, shapes, links and form fields out of given areas, or wherever a text or regular expression matches, instead of only covering them. The rest of the text keeps its place, partly covered images are written again with those pixels painted over, and the originals of redacted images and forms leave the file. - Barcode reader.
Barcode.Readreads QR codes, Data Matrix (square, rectangular and DMRE), Code 128 and EAN-13 from images, andPdfBarcodes.Findfrom PDF pages, with the corners, a GS1 flag and EPC and Swiss QR-bill payments parsed back. - Image pixels for OCR and image pipelines.
ImageToPixels.Convertdecodes PNG, JPEG, GIF, WebP, BMP and TIFF (any page) straight to grey, RGB or RGBA pixels, andPdfRenderer.RenderPagecan render into a caller's buffer as grey, RGB or RGBA. A 300 dpi A4 PNG decodes in 98 ms instead of 341 ms through a PDF, with 12.6 MB allocated instead of 227 MB. Rendering scanned pages one after another keeps far less memory. - Native command line tool. On a .NET 10 SDK,
dotnet tool install -g PdfPecker.Cliinstalls a Native AOT executable for Linux (glibc and musl), macOS and Windows, x64 and Arm64: the sample invoice converts in 17 ms instead of 355 ms. .NET 8 and 9 SDKs install the framework-dependent tool as before. On Windows the native tool starts throughpdfpecker.cmd. - Deferred fonts and hyphenation patterns.
FontCollection.AddDeferredregisters a face by family, weight, style and unicode-range and reads it only when a document needs it, andHyphenationPatterns.Deferreddoes the same for patterns. Font fallback skips families whose ranges cannot draw a character. CFF subsets of fonts such as Noto CJK are much smaller (a few Chinese characters in Noto Sans SC: 1.93 MB to 133 KB). - More CSS:
@page { bleed; marks: crop cross }with trim and bleed boxes,@page :nth()and page groups (:nth(1 of chapter)),if()withmedia(),supports()andstyle(),sibling-index()andsibling-count(),contrast-color(),object-view-box, inset box shadows on inline boxes, borders of<col>and<colgroup>in collapsed tables,visibility: collapseon table rows and columns,revertandrevert-layeron every property, and contextual alternates (calt,clig,rclt) by default, as Chrome applies them, so fonts such as Inter and Fira Code draw their arrows and programming ligatures. Fonts' Unicode variation sequences (cmap format 14) draw their variant glyphs. - Closer to Chrome: table headers and footers across page breaks (repeated only up to a quarter of the page, a table moved whole when its header does not fit, spacing dropped at a break), spanning cells that no longer run past the page end, grid
frrows of indefinite height and items spanning flexible columns, intrinsic widths that keepmin-widthand the automatic minimum of grid and flex items, column flex boxes with amin-height, border spacing in whole pixels, letter spacing that skips hidden characters, invisible characters no longer drawn as?or boxes, HTML character references decoded as browsers do (all 2,231 names), links inside transformed elements, and in SVGcurrentColorand fonts inherited through<use>, lengths with units, nestedsvgviewports and symbols clipped to their viewport. - Faster images: PNG encoding 19% faster, WebP 28 to 32% (PDF to HTML 12 to 15%, 65% less allocated), TIFF 14%, JPEG encoding 29% and decoding 25 to 35%, with pages of photos rendering 17 to 38% faster and multi-page conversions reusing their pixel buffers. Output bytes are unchanged.
- PDF renderer: non-isolated transparency groups blend with what is below them, transparency groups and soft masks cost only the area they draw (pages of hundreds of translucent boxes that were too complex at 300 dpi now render in milliseconds), Type 3 text honours invisible and clipping render modes, and colour spaces and functions are parsed once per document.
- Unicode normalization of its own. NFC, NFD, NFKC and NFKD come from the library's tables, so shaping, hyphenation and passwords behave the same with invariant globalization (Native AOT, containers) as on desktop .NET.
- Signatures: signatures are verified against the revision they signed, so a certification cannot be stripped by a later update, and the byte range check now also runs in encrypted files.
- PdfPecker.Fluent: vertical alignment in page headers, content and footers (
Content().AlignMiddle()centres a cover title as in QuestPDF), border calls in a row merge into one border, and braces in band Markdown stay text. - Hostile input: CMaps, colour spaces, functions, inline images, tagged tables, combining marks, nested flex items, foreign objects, columns in columns, blurred shadows and redaction areas are bounded, and object streams are decoded on the file's budget, so a page renders the same whatever was rendered before it.
Behaviour changes
- AES-256 passwords are prepared with SASLprep (ISO 32000-2), as pypdf and PDFBox do. Setting a password with control, private-use or bidi control characters, or with code points Unicode 3.2 did not assign (most emoji), now throws
ArgumentException. Files encrypted by 1.23.0 or other tools with such passwords still open. PdfTextreads in reading order by default. Multi-column and side-by-side pages give different text from 1.23.0; setPdfTextOptions.Order = PdfTextOrder.TopToBottomfor the old order.PdfSanitizerkeeps only http, https, mailto and tel links, and drops relative ones. A damaged file is written out again from what PdfPecker read; intact files still come back byte for byte.pdfpecker convert -reads local files only from--base-dir, no longer from the current folder. Pass--base-dir .to keep relative images working with piped HTML.- The LTV client never uses a proxy; a caller who needs one supplies an
HttpClient.convertandstampget-envforms of their password options. - The CLI with several inputs now keeps encryption, PDF/A, linearization and the creation date for the merged file, and
[page]and[topage]count the whole output as in wkhtmltopdf. PDF/A-4 and PDF/UA-2 with several inputs are refused with exit code 2.
Output changes
Golden baselines changed:
complex/scripts,features/tables,features/units-fonts,features/selectors-cascadeandrtl/demo:/ActualTextspans around Devanagari, Thai, Arabic and Hebrew clusters, so they copy as written. The pages render the same.complex/dashboard,features/effects,inline-borders/demoandtransparency/demo: transparency groups and soft masks get a bounding box round what they paint instead of the whole plane. The pages render the same, and faster in MuPDF and Poppler.features/images: SVG symbols are clipped to their viewport (pixel for pixel the same page).features/tables:border-spacing: 2ptis now 2px, as in Chrome.subgrid/demo: an item spanning1frandautocolumns no longer widens the auto column.
New golden pages features/contextual-alternates, features/table-column-borders, features/table-rowspan-breaks and features/table-visibility-collapse add baselines and change none.
Other documents change when they use what changed: fonts with contextual alternates, tables with border spacing in points or ems, tables that break across pages with headers, footers or spanning cells, grids with fr rows or spanning items, boxes with a min-width wider than their content, revert, invalid var() (the property is now unset), named character references in attributes, default ignorable characters, letter spacing next to hidden or supplementary characters, links in transformed elements, SVG sprites and symbols, and translucent boxes with a blend mode inside (now written as isolated groups).
The manual for this version: https://pdfpecker.net/docs/v1.24.0/
Full Changelog: v1.23.0...v1.24.0