Click or drag to resize
Pdf Library for .NET

Version 26.5 Release Notes - SelectPdf Library for .NET

Version 26.5 adds a remote engine, a table of contents with page numbers, fillable form fields from HTML forms, external signing (HSM, smart card, USB token or key service), long-term validation of signatures, and PDF/A-1a, 2a and 2u. It also speeds up parallel conversions on Windows and Linux and the saving of loaded documents. Code written for 26.4 compiles unchanged, with one rare exception listed under Behavior changes; read that section 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

Installing

The managed package plus a native engine package

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

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

Table of contents

Built by hand with internal links

Automatic, with page numbers, in three modes

HTML forms

Printed as static content

Optionally converted into fillable PDF form fields

Signing keys

PFX file or certificate store

Also HSM, smart card, USB token (PKCS#11) or key service, in one or two steps

Signatures

SHA-256

SHA-256, SHA-384 or SHA-512; long-term validation (PAdES B-LT)

Archiving levels

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

Adds PDF/A-1a, 2a and 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, the managers and the PDF tools are IDisposable

New features

Everything in this section is new compared with 26.4.

Engine and deployment

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

  • Remote engine. Set GlobalProperties.RenderingEngine to RenderingEngine.ChromiumRemote and GlobalProperties.EngineEndpoint to the engine's address, and HTML to PDF, HTML to image, PDF to text and PDF to image 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.

  • 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). One conversion at a time is unchanged on Linux and 35-60 ms slower on Windows.

HTML to PDF

  • Table of contents with page numbers:HtmlToPdfOptions.TableOfContents (PdfTableOfContentsOptions). FillExisting adds leaders and page numbers to the page's own table of contents; InsertHtml writes a table of contents into the page from its headings and then numbers it; GeneratePages inserts native table-of-contents pages at the start, after the first page or at the end, styled per level. Works with right-to-left and non-Latin pages and with headers and footers. See Generate Table of Contents.

  • HTML forms to fillable PDF fields:CreateFormFields on HtmlToPdfOptions and PdfHtmlElement turns text inputs, check boxes, radio buttons, selects and text areas into PDF form fields at the place of each control, with their values, labels and options. Works with PDF/A and PDF/UA output. See Html Forms to PDF Form Fields.

  • FitWideContent on HtmlToPdfOptions, PdfHtmlElement 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.

Signatures

  • External signing for keys the library never sees. Implement IPdfExternalSigner and pass it to PdfSecurityManager.Sign or to the new PdfDigitalSignatureElement constructors. For a remote signing service, sign in two steps: PrepareExternalSignature returns the digest to sign, and CompleteExternalSignature writes the value into the prepared document. Every value is checked against the signing certificate before it is written.

  • Ready-made signers:PdfCertificateStoreSigner signs with a certificate from the Windows, macOS or Linux certificate store by thumbprint; the token's middleware asks for its PIN. PdfPkcs11Signer signs through a PKCS#11 library (USB token, smart card, HSM). Both were verified with a qualified certificate on a USB token; Adobe Acrobat reports the signatures as qualified electronic signatures.

  • Long-term validation:EnableLtv on PdfDigitalSignatureElement and PdfSecurityManager embeds the revocation data (OCSP responses or CRLs) of the certificate chain when the document is saved, so the signature can be validated after the certificates expire or the services go offline. The save fails, and leaves the target file alone, when the revocation data cannot be obtained. PdfSignatureValidationResult.IsLtvEnabled reports it, and validation uses the embedded data first.

  • DigestAlgorithm (PdfSignatureDigest.SHA256, SHA384, SHA512) on the manager and the element.

  • Signature appearance. The visible signature shows the signer's name in large type on the left and the signer, reason, location and date on the right, over a faint background. SignatureBackgroundImage replaces the background with your logo and SignatureBackgroundOpacity sets how faint it is. PdfSecurityManager.Sign now draws this appearance too.

  • Signing with a field name the document already has as an empty signature field signs that field, on its own page and position.

See Digital Signatures.

Standards

  • PdfStandard.PdfA1A, PdfA2A and PdfA2U. PDF/A-1a is the PDF/A-1 level that combines with PDF/UA-1. The A levels turn tagging on for HTML and Word conversions. ConvertToPdfA accepts all three, and PDF/A-3a too. See Accessible PDF and PDF/A.

Documents, images and text

  • ImagesMaxResolution on HtmlToPdfOptions, WordToPdfOptions 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 Pdf Compression.

  • IDisposable:PdfDocument, PdfFormManager, PdfPortfolioManager, PdfRedactionManager, PdfResizeManager, PdfSecurityManager, PdfToText and PdfRasterizer can be used in a using statement. Dispose does what Close does, and calling both is safe. PdfRasterizer gains Close.

  • PdfDigitalCertificatesCollection is disposable and releases the private keys it loaded. Before, the key files Windows and macOS create for an imported key stayed behind until a garbage collection, or for good if the process ended first. Dispose it after the document is saved, since signing happens at the save.

  • HtmlToPdfResult.PdfPageCountBeforeLimit: the number of pages the content produced before an edition page limit. In this edition it equals PdfPageCount.

  • Vertical writing. Text set with writing-mode: vertical-rl is redacted by phrase, including phrases that continue in the next column. PdfToText reads it column by column and finds phrases in it.

Improvements and fixes

Performance

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

  • Saving a loaded document is much faster: a 344-page document loads and saves in about 40-60 ms instead of 1.3-4.3 s.

  • Saving a loaded document with PdfCompressionLevel.NoCompression no longer compresses its page content.

Text, fonts and scripts

  • PdfToText.Search finds Chinese, Japanese, Korean, Hindi, Thai and Arabic terms; before, it found no term outside ASCII. Arabic words, including words with vowel marks, are extracted whole, and Indic vowel signs stay on their own consonant.

  • PdfTextElement and PdfTextSection shape Indic, Thai, Lao, Tibetan, Myanmar and Khmer text. Shaped Indic text is extracted in the order it was written, and redaction removes it exactly.

  • Word to PDF draws text in scripts the run's own font cannot draw: Chinese and Japanese characters no longer overlap, Devanagari is drawn, and Korean is laid out with the face that draws it, on Windows, Linux and macOS.

  • PdfRasterizer draws Times and Courier text that is not embedded with the right glyphs (they were swapped), draws CJK text whose fonts are not embedded (from the fonts folder or the Fonts package first, then the system's fonts), draws CJK standard fonts correctly even after a temporary-file cleaner has run, and strokes Type3 glyphs in the stroke color.

  • macOS: text in fonts such as Heiti is drawn with the right characters; Times, Courier and the Hiragino Pro families are found as installed; converting a document to PDF/A no longer waits for a system dialog when it names a downloadable font the Mac does not have.

Accessibility and archiving

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

  • Tagged HTML: a <figure> is described by its picture's alternate text instead of a placeholder; lists with letters, roman numerals or custom markers declare their numbering (PDF/UA-2); text that was missing from the reading order is included. GitHub and Chinese Wikipedia, for example, now validate at PDF/UA-1 and PDF/UA-2, and Arabic Wikipedia can be saved as PDF/UA where it was refused.

  • Shapes and images marked Artifact on a converted PDF/UA page no longer make the save refuse the document.

Signing and security

  • Signing a reopened PDF/A document a second time with PdfDigitalSignatureElement no longer breaks its PDF/A conformance.

  • Signing an encrypted document that is already signed no longer invalidates the earlier signatures.

  • 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.

Conversion

  • 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").

  • 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.

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

Multithreaded use

  • A document built on a thread where a tagged document was worked on no longer ends up with that document's tagging, and the tagged document no longer gains its links.

  • 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.

  • Creating a form field while another thread closes a document no longer fails.

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.

  • PdfSecurityManager.Sign draws the signature's appearance in the rectangle you give; before, the rectangle was left empty.

  • new PdfDigitalSignatureElement(x, y, width, height, null) no longer compiles, because a second constructor takes an external signer. Cast the null to PdfDigitalCertificate.

  • PdfToText.Close moved to the PdfTool base class, so PdfRasterizer has it too; code calling it is unchanged.

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

Packages
  • 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.

  • SelectPdf.Universal, one SelectPdf.Universal.Native.<rid> per platform (win-x64, win-x86, linux-x64, linux-arm64, osx-arm64) and the optional SelectPdf.Universal.Fonts, as in 26.4.

  • New: SelectPdf.Universal.Windows, SelectPdf.Universal.Linux, SelectPdf.Universal.Linux.Arm64 and SelectPdf.Universal.MacOS, each installing SelectPdf.Universal with the engine package for its platform in one step (there is none for win-x86). A project references one of them, or the managed and native packages - not both. See Installation.

  • The SelectPdf.Universal package now contains PKCS#11 support (Pkcs11Interop, Apache License 2.0); its license and notice are included in the package.

  • The remote engine ships as the container image ghcr.io/selectpdf/engine for linux/amd64 and linux/arm64, with a Helm chart.

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 or to HTML to image.

  • An external signer must sign with RSA (PKCS#1 v1.5) or ECDSA; RSA-PSS values are refused.

  • Long-term validation cannot be enabled when signing in two steps. An OCSP responder that answers "revoked" produces no embeddable answer, so such a certificate cannot be made LTV-enabled through OCSP.

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

See Also