Version 26.4 Release Notes - SelectPdf Library for .NET | |
Adds ZUGFeRD and Factur-X electronic invoices, moves the Chromium engine to Chromium 154, makes the output of the Chromium and Blink engines follow the page much more closely, and saves very large documents dramatically faster.
Electronic invoices - PdfDocument.AddZugferdInvoice turns a PDF/A-3 document into a ZUGFeRD / Factur-X hybrid invoice: it embeds the invoice XML and writes the metadata invoice software looks for. All profiles (ZugferdProfile), the older ZUGFeRD 2.0 metadata (ZugferdSchema), new documents and loaded PDF/A-3 files. See Electronic Invoices (ZUGFeRD / Factur-X).
Custom XMP metadata - PdfDocument.AddXmpExtensionSchema declares your own metadata schema and writes its values, keeping the document PDF/A conformant.
Chromium 154 - the Chromium engine runs on CEF / Chromium 154. A page that never finishes loading no longer hangs the conversion, the engine's own processes end with it, it opens no listening network sockets (no Windows Firewall prompt), a page that redirects itself in script is printed as the page it lands on, and plain URL conversions navigate straight to the target. The Blink engine stays on Chromium 148.
Pages end where the content ends - with the Chromium engine the last page is cut where the content stops, on documents of any length, with no trailing blank page. Controlled by ManagedContentTrimming and ManagedContentTrimmingMode on the converter, PdfHtmlElement and PdfHtmlSection.
HTML elements flow across pages - with the Chromium engine a PdfHtmlElement placed part-way down a page continues on the following pages, and an element with a Height taller than the room left continues until that height has been drawn.
Partial page conversion on every engine - VisibleWebElementId now works for HTML to PDF with the Chromium and Blink engines, and the new VisibleWebElementSelector takes any CSS selector on those engines. See Partial Page Conversion.
WebGL control - WebGlEnabled on the converter, HtmlToImage, PdfHtmlElement and PdfHtmlSection (Chromium and Blink).
RenderPageOnTimeout is honored by the Chromium engine, so a page that exceeds MaxPageLoadTime can still be rendered. See Conversion Delay and Timeout.
Faster large documents - building and saving a document is now linear in the number of PDF objects. At 160,000 objects, saving went from 80 s to 2.2 s and building the document from 91 s to 1.1 s in our measurements.
WebGL is off by default on the Chromium and Blink engines, which also makes conversions faster. Pages whose content is WebGL (interactive maps, 3D charts) need WebGlEnabled = true.
WebPageFixedSize now truncates on Chromium and Blink. Earlier versions ignored it on these engines and converted the whole page. With WebPageFixedSize = true and a WebPageHeight, the content below that height is now left out. WebPageHeight on its own still only sets the browser viewport height.
Saving the same PdfDocument twice throws instead of writing a file with no pages. Save once - to a byte array if you need the document in more than one place. A save refused for a fixable reason can be retried after the fix.
Docked headers and footers keep their size - a docked template is drawn at its own size and clipped by the page, instead of being stretched or squeezed to the page width.
Pages end where the content ends with the Chromium engine. Set ManagedContentTrimming = false for the previous page cutting.
Partial conversion of an element that does not exist is an error on the Chromium and Blink engines, instead of a conversion of the whole page.
LazyImagesLoadingDelay defaults to 50 ms (was 20 ms).
The Chromium engine files ship in Chromium-CEF-154.0.8037 (was Chromium-CEF-148.0.7778). The NuGet packages deploy it automatically; a build step that copies the engine folder itself needs the new name.
Right-to-left pages are no longer shifted off the left edge with the Chromium engine.
Automatic bookmarks created with the Blink engine point at the top of their heading.
A docked header or footer is no longer stretched on pages of a different size than the one it was made for.
Element ids that are valid HTML but not valid CSS (such as 2col) work for partial conversion.
Opening a PDF that references a missing object stream no longer crashes.
Content added to PDFs created with "Microsoft Print to PDF" is no longer drawn mirrored and scaled.
Embedded file names are recorded as given, never expanded to a full path of the creating machine.
PdfResizeManager.PageMargins works when the original page settings are kept.
Text extraction and search: words with ligatures (fi, ff, fl) no longer come out with a space in place of the ligature.
A save that fails no longer leaves the output file locked.
Select.Pdf.Extras: compressing a PDF 2.0 document no longer adds a producer entry of its own to the document's XMP metadata.