Click or drag to resize
Pdf Library for .NET

Version 26.6 Release Notes - SelectPdf Html To Pdf Converter

Version 26.6 saves documents linearized for the web (Fast Web View), waits for web fonts that start loading after the page has loaded, prints right-to-left pages in place, and fixes header and footer settings that were ignored; pages appended from other documents keep their own layout, Indic and Thai text in header and footer sections is shaped more accurately, and appending damaged PDF files no longer fails. Code written for 26.5 compiles unchanged; read Behavior changes before you upgrade.

New features
  • Setting PdfDocument.Linearize to true saves the document linearized ("Fast Web View"): first page first, with hint tables, so a viewer that reads them - Chrome, Edge, Adobe Acrobat - shows the first page of a large document served over the web before the rest has arrived. An encrypted document keeps its passwords and permissions, and a PDF/A document keeps its conformance. See Fast Web View.

  • WaitForWebFonts (HtmlToPdfOptions and PdfHtmlSection; true by default) waits for web fonts still loading before the page is measured and printed. A web font first used after the page's load event - by text a script adds, or a style switched later - could be printed in a fallback font while it was still downloading. The wait ends after 10 seconds at most.

  • .NET 11 is supported: applications targeting net11.0 use the library unchanged (26.5 was verified with .NET 11 RC 1).

Improvements and fixes
  • PdfPage.DisplayHeader and DisplayFooter hide the header and footer on a page of a converted document; they did nothing there.

  • PdfTextSection.Transparency and PdfImageSection.Transparency are applied (the text section's covers its background too); they were accepted and ignored.

  • PdfImageSection draws BMP, GIF, WebP and TIFF images (the first frame), not only PNG and JPEG. A JPEG with stray bytes after a segment no longer hangs, and a PNG with an empty private chunk is drawn instead of failing.

  • PdfViewerPreferences.NonFullScreenPageMode and HtmlToPdfViewerPreferences.NonFullScreenPageMode are written to the file; they were kept on the object only.

  • PdfTextSection: Kannada and Malayalam conjuncts are formed, the Devanagari visarga takes its own advance instead of overlapping the next letter, Kannada and Telugu text is extracted by PDF readers in the order it was written, and Thai text drawn with a font that has Thai ligatures, such as Noto Sans Thai, uses them.

  • PdfTextSection text drawn with an embedded font and WordSpacing, or justified, ends where it was measured: every space of a run of spaces takes the word spacing, and a justified line reaches its margin.

  • Windows and macOS: when the application's fonts folder holds several weights of a family, font-weight: 400 text is drawn in the regular face (the light face could be used).

  • PdfDocument.Append appends a damaged PDF file that other readers open: when a file cannot be read as written (a damaged or missing cross-reference table, wrong offsets or stream lengths), it is read again with its structure rebuilt from the objects it contains. Set GlobalProperties.AutoRepair to false to refuse such files instead.

  • PdfDocument.Append reads PDF files it failed on: a number written with a trailing period (such as 300.) before a line break, a page tree with an entry that is missing or not a page, and objects that refer to each other in a cycle, which crashed the process with a stack overflow.

  • Linux and macOS, with the engine in process: a child process of the application that exits while the engine starts is no longer left waiting until its timeout.

  • A page that calls window.print() while it loads (receipts and invoices often do) converts normally; the conversion waited until it timed out.

  • PdfDocument.Append: the appended document keeps its page labels (such as i, ii, iii); they were dropped.

  • PDF/A-1b and PDF/X-1a output (PdfStandard.PdfA and PdfX), which allow no transparency, paints see-through content as it showed over a white page: grey text, light tints and translucent backdrops came out black or as dark boxes. Images with transparency are drawn onto white, and PDF/X-1a output converts compressed images stored with a predictor to CMYK; they stayed RGB.

  • macOS: compressed images with transparency keep their colors; red and blue could be swapped.

  • A page whose root element is right-to-left (<html dir="rtl">: Arabic, Hebrew and Persian sites) is printed in place at any WebPageWidth; it was shifted sideways.

  • A page with smooth scrolling (scroll-behavior: smooth) and a sticky or fixed header prints its header at the top of the page; the header could be drawn over the content below it.

  • When the Chromium engine cannot be found, the error names the folders that were searched (for a web site, its bin folder). It named the process's current folder, which under IIS is a system folder.

  • .NET Framework projects that use packages.config (ASP.NET Web Forms, MVC 5, desktop applications) get the Chromium engine in their bin folder: NuGet installs the Windows engine packages, which it refused in 26.5 as having no compatible files. An ASP.NET Web Site (a site opened as a folder, without a project file) runs no package build step, so these files are copied by hand there; see Installation.

Behavior changes
  • Pages added with PdfDocument.Append, or taken from another document with Pages.Add, Pages.Insert, AddPage(PdfPage) or InsertPage(int, PdfPage), no longer show the document's header and footer, which were drawn over the page's own content; a page added afterwards shows them again.

  • With RenderingEngine.ChromiumRemote, the library connects to the engine directly and no longer goes through the proxy set by HTTP_PROXY, HTTPS_PROXY or the system: an engine on the same host or network was unreachable without NO_PROXY, and the access token was sent to the proxy. A deployment that can reach the engine only through a proxy needs a direct route to it.

  • With Header.DisplayOnFirstPage = false and the header shown on odd and even pages, the content of the first page now starts where the header would have been, instead of below a blank band of the header's height, so more fits on the first page and page breaks can move. To keep the space, add a top margin to the first element of your HTML. The first page keeps the header's space with WebPageFixedSize, FitWideContent, a PageRanges without page 1, or when the page has a fixed-position footer.

See Also