Repository navigation
v1.23.0
Highlights
- Three new packages, released with PdfPecker under the same version:
- PdfPecker.Cli, the
pdfpeckerdotnet tool:convert(HTML or Markdown, files or standard input),watch,merge,split,extract,remove,rotate,stamp,compact,linearize,sanitize,sign,verify,encrypt,decrypt,to-image,to-html,textandinfo. A call without a command reads wkhtmltopdf's options, header and footer texts included. It has no dependencies and refuses web addresses. - PdfPecker.Razor:
RazorToPdfrenders a.razorcomponent with Microsoft'sHtmlRendererand converts it, so templates get typed parameters, child components, layouts and dependency injection without an ASP.NET Core host. Trimmable and AOT-compatible. - PdfPecker.Testing:
PdfAssert.MatchesSnapshotcompares a PDF with a stored one object by object, ignoring dates and IDs, and writes expected, actual and diff page images when they differ;ContainsText,DoesNotContainTextandHasPageCountcheck the rest. No test framework dependency.
- PdfPecker.Cli, the
- Existing PDFs to PDF/A.
PdfToPdfA.Convertturns a PDF from any tool into PDF/A-2b, 2u, 3b or 3u without rasterizing it: it embeds missing fonts, repairs embedded TrueType programs, adds the output intent and XMP metadata, removes forbidden actions and gives annotations appearances, and reports what it changed and what it could not fix. veraPDF checks all four levels in CI. - PDF to Markdown.
PdfToMarkdownwrites the structure PdfToHtml finds as GitHub Flavored Markdown: headings, paragraphs, lists, bold and italic, links and pipe tables. - Barcodes:
Barcode.DataMatrixandBarcode.Gs1DataMatrix(ECC 200, GS1 element strings with FNC1), and Swiss QR-bills:SwissQrBillbuilds and checks the payload (IBAN, QR-IBAN, QR and creditor references) andBarcode.SwissQrCodedraws it with the Swiss cross. - Empty signature fields. An element with
data-pdf-signature="Name"becomes an empty signature field thatPdfSignersigns later withFieldName = "Name", tagged as PDF/UA asks. - Templates from Prince, WeasyPrint and Chrome: running elements in page-margin boxes (
position: running(name)withcontent: element(name), picked byfirst,start,lastandfirst-except),@scopefor component styles, CSSzoomas Chrome computes it, and even-page headers and footers (data-sticky-pdf-even-headeranddata-sticky-pdf-even-footer) for documents printed on both sides. - More CSS: typed
attr()in any property (CSS Values 5, as in Chrome 133), gap decorations in grid and flex containers (row-rule,column-rulelists,rule-break,rule-inset),box-decoration-break: clonefor block boxes split across pages,size-adjust,ascent-override,descent-overrideandline-gap-overridein@font-face,target-counters(),white-space-collapse,hyphenate-limit-lines,accent-colorandappearance: nonefor check boxes and radio buttons,:in-rangeand:out-of-range,image-rendering: pixelatedandcrisp-edges,continue: discard,@page { size: 80mm auto }for pages as tall as their content, and in SVGvector-effect: non-scaling-stroke, CSStransformwithtransform-box, and the geometry (cx,r,d, ...) and gradient stop properties from style sheets. - PdfPecker's own properties:
-pdfpecker-repeat: each-pagedraws a box again on its parent's later pages, and-pdfpecker-image-qualityand-pdfpecker-image-max-resolutionmake PDFs with photos smaller. - Page numbers in any style: the
{page},{pages},{total-pages}and{section-page:id}tokens in running headers and footers take a counter style, such as{page:upper-roman}, including the document's@counter-stylerules. - Tagged PDF:
role="math"becomes a Formula with its alternative text,role="doc-index"an Index,role="doc-toc"a TOC with TOCI entries, anddata-pdf-list-labelmarks a hand-made list label as Lbl. - Closer to Chrome: shapes drawn by an SVG
<use>inherit its fill and stroke (sprite icons, MathJax formulas in coloured text), the SVG viewBox scale is exact (MathJax formulas no longer lose their last glyph), andposition: fixedboxes such as watermarks paint over the running headers and footers. - Existing PDFs:
PdfLinearizerlinearizes and encrypts in one pass, and opens encrypted input with its password. - PdfPecker.Fluent: more QuestPDF calls port unchanged:
DocumentOperation(merge, overlay, underlay, attachments, encrypt, linearize),ImageandSvgImageobjects withWithCompressionQuality,WithRasterDpiand the document image settings, pageBackgroundandForeground,Repeat,StopPaging,ContinuousSize,ExtendLastCellsToTableBottom,Overline,BreakAnywhere, the direction calls and everySemantic*call,Format(PageNumberFormat)for page numbers, gradients andOpacity.Document.Merge,EvenPageHeaderandEvenPageFooter,HyphenateandLanguage. New:Chart(column, bar, line and pie charts),Leaderin text,Markdowncontent,TableOfContentsfrom headings,SignatureField,DataMatrix,Gs1DataMatrix,SwissQrCodeand the wholeSwissQrBillpayment part with its receipt. - Hostile input and speed: a line's footnotes are handed on in linear time (10,000 footnotes on one line in 0.85 s instead of 21 s), stacked floats are no longer quadratic (60,000 floats in 0.3 s instead of 7.1 s),
@scopelimits are found in one walk (21 s to 2.4 s for the worst case),PdfSanitizerremoves active annotations in one pass (35 s to under a second), SVG foreign objects inside patterns and masks no longer throw, and character references such as�decode as U+FFFD instead of throwing.
Output changes
Golden baselines changed only where inline SVG is drawn: the viewBox scale is now written with six decimals instead of three, which moves SVG drawings by a fraction of a point (complex/svg-charts, features/images, features/paged-content, image-formats/demo, svg-effects/demo, translucent-effects/demo, and the fluent catalogue and invoice through their barcodes). Documents with inline SVG, especially formulas with large viewBoxes, can therefore differ byte for byte from 1.22.0. New golden pages (features/math-svg, svg-css-geometry, svg-effects/non-scaling-stroke-transform-box, box-decoration-break/demo, features/font-face-metrics, features/gap-decorations, features/attr-charts) add baselines and change none.
Other documents change only when they use a new feature: shapes inside <use> that set no paint of their own now take the <use> element's, and fixed boxes with a z-index of auto or more now paint over the running headers and footers.
The manual for this version: https://pdfpecker.net/docs/v1.23.0/
Full Changelog: v1.22.0...v1.23.0