Click or drag to resize
Pdf Library for .NET

Version 26.5 Release Notes - SelectPdf Html To Pdf Converter

Version 26.5 adds a remote engine, one-package installs per platform, a way to tell when the 5-page limit cut a document, and PDF/A-2u. It also speeds up parallel conversions on Windows and Linux. Code written for 26.4 compiles unchanged; read Behavior changes before you upgrade.

At a glance

Area

26.4

26.5

.NET

.NET Standard 2.0, .NET 8, .NET 9, .NET 10

The same, and verified with .NET 11 RC 1

Where the engine runs

In the application's process, or a separate process on the same machine

Also in a container on another machine (RenderingEngine.ChromiumRemote)

Alpine Linux and other musl-based systems

Not supported

Supported through the remote engine

Installing

The managed package plus a native engine package

Either that, or one package per platform: SelectPdf.HtmlToPdf.Windows, .Linux, .Linux.Arm64, .MacOS

The 5-page limit

No way to tell a cut document from a 5-page one

HtmlToPdfResult.PdfPageCountBeforeLimit

Archiving levels

PDF/A-1b, 2b, 3b, 3u, 4, 4e, 4f, PDF/X-1a

Adds PDF/A-2u

Parallel conversions in process (8 threads, conversions per minute, one test machine each)

Windows 624-672, Linux about 1,000

Windows about 1,020, Linux about 2,500

using statements

Not supported (call Close)

PdfDocument is IDisposable

New features

Everything in this section is new compared with 26.4.

Engine and deployment

  • Verified with .NET 11 RC 1 (11.0.0-rc.1): applications targeting net11.0 use the library unchanged on Windows x64, Linux x64 and ARM64, and macOS on Apple Silicon, with the engine in process and out of process.

  • Remote engine. Set GlobalProperties.RenderingEngine to RenderingEngine.ChromiumRemote and GlobalProperties.EngineEndpoint to the engine's address, and conversions run in the ghcr.io/selectpdf/engine container instead of the application's machine. The application then needs no native package, so it can run on Alpine Linux and other musl-based systems, where the native engines do not run; verified with an application on mcr.microsoft.com/dotnet/aspnet:10.0-alpine. EngineAccessToken authenticates it and EngineTimeout bounds a call. Local files an HTML string references are sent with it. A Helm chart and tested setups for Docker Compose, Azure Container Apps, Amazon ECS, Google Cloud Run and Kubernetes are included. See Remote Engine.

  • One package per platform.SelectPdf.HtmlToPdf.Windows (Windows x64), SelectPdf.HtmlToPdf.Linux (Linux x64 and Docker), SelectPdf.HtmlToPdf.Linux.Arm64 and SelectPdf.HtmlToPdf.MacOS (Apple Silicon) contain no code: each installs SelectPdf.HtmlToPdf.Universal together with the engine package for that platform. Install one of them, or the two packages as before. See Installation.

  • Faster parallel conversions in process. With 8 conversions at once, measured on one machine each: Windows from 624-672 to about 1,020 conversions per minute, Linux from about 1,000 to about 2,500. How much a Windows machine gains depends on how fast it starts processes (antivirus scanning slows that down).

HTML to PDF

  • HtmlToPdfResult.PdfPageCountBeforeLimit: the number of pages the content produced before the 5-page limit. When it is larger than PdfPageCount, the limit cut the document. See Getting Started.

  • FitWideContent on HtmlToPdfOptions and PdfHtmlSection: content wider than WebPageWidth is scaled down to fit the page instead of being cut at the right edge. Off by default. See Resizing Content During Conversion.

  • An HTML string with an http(s) base URL is the page at that URL. Web fonts, fetch calls, module scripts and cookies on the base URL's own server now work as they do when you convert the URL. See Convert Html Code To Pdf.

  • ImagesMaxResolution on HtmlToPdfOptions and PdfDocument resamples images drawn at more than the given pixels per inch down to it, which makes files with large photos much smaller. Off by default. See Options Review.

  • PdfStandard.PdfA2U: PDF/A-2 at level U (all text maps to Unicode).

  • PdfDocument is IDisposable and can be used in a using statement. Dispose does what Close does, and calling both is safe.

Improvements and fixes
  • Long HTML documents convert faster, with the same output: a 177-page document went from 2.7 s to 1.0 s.

  • A page that redirects or reloads itself while it is printed (for example www.bing.com in a Linux container) is printed as it was, instead of failing with "PrintToPDF failed".

  • LoginOptions: the conversion waits for the login form's own submission to finish, so a slow login no longer prints the target page without the session.

  • A rooted file path such as /home/me/page.html converts on Linux and macOS (it failed with "Invalid URI").

  • An encrypted document declares the PDF version its encryption belongs to: AES-256 documents are written as PDF 1.7 and declare the handler as an Adobe extension (level 8 for revision 6, level 3 for revision 5), as Acrobat does, and AES-128 documents as PDF 1.6. Both were written as PDF 1.5, a version that has neither.

  • Hierarchical bookmarks nest by heading level: two h3 headings after an h1 are siblings, not parent and child.

  • PdfDocument.Append: when both documents define the same named destination (an HTML anchor such as #top), the appended document's is renamed, so links in the first document no longer lead into the second.

  • PDF/X-1a: photographs carried in ICC-based or calibrated color spaces are converted to CMYK (they stayed RGB), and keep their JPEG compression.

  • PdfTextSection shapes Indic, Thai, Lao, Tibetan, Myanmar and Khmer text.

  • macOS: text in fonts such as Heiti is drawn with the right characters, and Times, Courier and the Hiragino Pro families are found as installed.

  • Windows, in process: an application that creates windows by class atom on another thread no longer crashes while the engine starts.

  • Multithreaded use: a PDF/A conversion running on one thread no longer affects documents saved on other threads, and a PDF/A-1b document no longer fails validation because of transparency drawn on another thread.

Behavior changes
  • An HTML string converted with an http(s) base URL has that URL as its origin (it had a file:// origin). An absolute file:// resource in such a string is refused, as on any web page. An empty or file:// base URL works as before.

  • The Producer of generated PDF files reads SelectPdf for .NET v26.5.0.

Known limitations
  • The remote engine always denies local file access to the pages it converts. Pass local resources through an HTML string, which sends them along, or serve them over HTTP.

  • FitWideContent applies to PDF output with an automatic page height; it does not apply with WebPageFixedSize.

  • Videos encoded with H.264 or AAC print as empty boxes: the engine includes no proprietary codecs. A poster image still prints.

  • The table of contents, HTML forms to PDF fields, signatures and PDF/A-1a and 2a are in the Full edition (SelectPdf.Universal).

See Also