Native Stack & Licensing

FolioPDF bundles three native engines — Skia, PDFium, and qpdf — with zero managed runtime dependencies. This page documents the versions, licenses, and customizations applied to each component.

Architecture Overview

Every FolioPDF API routes to exactly one of three native backends:

EngineBinaryRole
Skia FolioSkia.dll / libFolioSkia.so Renders new PDFs from layout code, encodes images (PNG/JPEG/WebP), HarfBuzz text shaping
qpdf qpdf30.dll / libqpdf.so.30 Restructures existing PDFs: encrypt, decrypt, merge, split, linearize, overlay, attach files, edit metadata
PDFium FolioPdfium.dll / libFolioPdfium.so Parses existing PDFs: text extraction, page rendering, form fields, signing, redaction, image extraction

One-line mental model: Skia writes pixels. qpdf restructures objects. PDFium parses content.

Component Versions

Linked into FolioSkia

ComponentVersionLicenseRole
Skiam147 (Chrome 147)BSD-3-Clause2D rendering engine, PDF generation backend
HarfBuzzbundled with Skia m147MITOpenType text shaping for complex scripts
libgrapheme3.0.0 (Unicode 17.0.0)ISCGrapheme/word/line segmentation (replaces ICU)
icu_bidibundled with Skia m147Unicode-DFS-2016Bidirectional text reordering (Arabic/Hebrew)
FreeTypebundled with Skia m147FTL (BSD-style)Font rasterization
libpngbundled with Skia m147libpng-2.0PNG encode/decode
libjpeg-turbobundled with Skia m147BSD-3-Clause + IJGJPEG encode/decode
libwebpbundled with Skia m147BSD-3-ClauseWebP encode/decode
wuffsbundled with Skia m147MITSafe image codec wrappers
expatbundled with Skia m147MITXML parsing (SVG module)
zlibbundled with Skia m147ZlibDEFLATE compression

Linked into qpdf

ComponentVersionLicenseRole
qpdf12.3.2 (ABI 30)Apache-2.0PDF object manipulation engine
OpenSSL3.xApache-2.0AES-256 encryption, CMS signing
libjpeg-turbobundled with qpdfBSD-3-Clause + IJGJPEG codec for qpdf streams
zlibbundled with qpdfZlibDEFLATE for qpdf streams

Linked into FolioPdfium

ComponentVersionLicenseRole
PDFiumchromium/7690 (m147 era)BSD-3-ClausePDF parsing, AGG rendering, text extraction, form access
AGGbundled with PDFiumBSD-3-ClauseAnti-aliased 2D rasteriser for page-to-bitmap
OpenJPEGbundled with PDFiumBSD-2-ClauseJPEG 2000 decoder
lcms2bundled with PDFiumMITICC color management
libtiffbundled with PDFiumlibtiff (BSD-style)TIFF image decoding
abseil-cppbundled with PDFiumApache-2.0C++ utility library

Downstream Customizations

Note: All native components are permissively licensed (BSD, MIT, Apache-2.0, ISC, Zlib, FTL). None are GPL/LGPL/MPL. The combined binaries can be redistributed under a proprietary license.

qpdf Extensions

FolioPDF carries a small downstream patch on qpdf 12.3.2 that adds two features required for ZUGFeRD / Factur-X / PDF/A-3 compliance:

  • extendMetadata — a top-level JSON job key that appends RDF/XMP fragments to the document's /Metadata stream. Used by PdfEditor.ExtendXmpMetadata() and DocumentOperation.ExtendMetadata() to inject Factur-X namespace declarations, PDF/UA identification, and Dublin Core fields without replacing the entire XMP packet.
  • addAttachment.relationship — a sub-key under add-attachment that sets the PDF/A-3 /AFRelationship entry on the file specification dictionary and adds the file spec to the document-level /AF array. Required for Factur-X/ZUGFeRD compliance where the CII XML must declare /AFRelationship /Alternative.

The patch is applied automatically by the build scripts before compilation. When bumping the qpdf version, the patch is re-validated against the new source — git apply will fail loudly if anything conflicts.

PDFium Extensions

FolioPDF carries one downstream patch on PDFium chromium/7690:

  • Redaction annotation support — adds FPDF_ANNOT_REDACT to the allowlist in FPDFAnnot_IsSupportedSubtype(), enabling the standard two-phase redaction workflow (create REDACT annotations, then flatten the page). The internal PDFium machinery already supports REDACT — only the public API allowlist was missing the entry.

FolioPDF also includes custom C++ extensions compiled into libFolioPdfium:

  • Bookmark editingFPDFBookmark_Add, FPDFBookmark_Delete, FPDFBookmark_Move, FPDFBookmark_SetTitle, FPDFBookmark_SetDest for programmatic bookmark/outline tree manipulation.
  • Metadata editingFPDFInfo_SetMetaText for writing /Info dictionary entries (Title, Author, Subject, etc.) directly via PDFium internals.
  • CMS signing — PKCS#7 detached signature orchestrator using OpenSSL's PKCS7_sign against the libcrypto already shipped with qpdf, enabling digital signing without adding any managed dependencies.
  • CMS verificationPKCS7_verify wrapper for cryptographic signature validation, also routed through the bundled libcrypto.

Skia Configuration

FolioSkia is a custom C++ wrapper around Google Skia m147 built with specific configuration flags:

  • skia_use_freetype=true — FreeType for font rasterization (no system font dependencies)
  • skia_pdf_subset_harfbuzz=true — HarfBuzz subset for PDF text shaping
  • skia_use_libgrapheme=true — libgrapheme instead of full ICU (eliminates the 27 MB icudtl.dat data file)
  • No SkiaSharp — FolioPDF owns the full native interop via P/Invoke bindings

Platform Binaries

Windows x64

FileComponent
FolioSkia.dllSkia + HarfBuzz + FreeType + libgrapheme + image codecs
FolioPdfium.dllPDFium + AGG + OpenJPEG + lcms2 + signing extensions
qpdf30.dllqpdf 12.3.2 with FolioPDF patches
jpeg62.dlllibjpeg-turbo (qpdf dependency)
libcrypto-3-x64.dllOpenSSL 3.x cryptographic primitives
libssl-3-x64.dllOpenSSL 3.x TLS (transitive, not used at runtime)
zlib1.dllzlib (qpdf dependency)

Linux x64

FileComponent
libFolioSkia.soSkia + HarfBuzz + FreeType + libgrapheme + image codecs
libFolioPdfium.soPDFium + AGG + OpenJPEG + lcms2 + signing extensions
libqpdf.so.30qpdf 12.3.2 with FolioPDF patches
libjpeg.so.62libjpeg-turbo (bundled, RPATH=$ORIGIN)
libcrypto.so.3OpenSSL 3.x (bundled, RPATH=$ORIGIN)
libz.so.1zlib (bundled, RPATH=$ORIGIN)

Linux bundling: All transitive .so dependencies are bundled alongside libqpdf.so.30 with RPATH=$ORIGIN so they load from the same directory at runtime. This eliminates the need for system-installed libjpeg-turbo, OpenSSL, or zlib — the NuGet package is self-contained.

Acknowledgements

FolioPDF is built on the work of these open-source projects and their contributors:

  • Skia by Google — the 2D rendering engine that powers Chrome, Android, and Flutter. BSD-3-Clause license.
  • qpdf by Jay Berkenbilt — the PDF transformation library used for encryption, linearization, merging, and metadata. Apache-2.0 license. FolioPDF extends qpdf with extendMetadata and addAttachment.relationship for PDF/A-3 and ZUGFeRD compliance.
  • PDFium by the Chromium Authors — the PDF parser and renderer used for text extraction, form access, signing, and page rasterization. BSD-3-Clause license. FolioPDF extends PDFium with bookmark editing, metadata editing, and CMS signing support.
  • HarfBuzz by Behdad Esfahbod and contributors — the OpenType text shaping engine. MIT license.
  • OpenSSL by the OpenSSL Project — cryptographic primitives for AES encryption and PKCS#7 signing. Apache-2.0 license.
  • FreeType by David Turner, Robert Wilhelm, and Werner Lemberg — font rasterization. FreeType License (BSD-style).
  • Lato by Lukasz Dziedzic (tyPoland) — the default font family bundled with FolioPDF. SIL Open Font License 1.1.
  • Inter by Rasmus Andersson — the secondary font family bundled with FolioPDF. SIL Open Font License 1.1.

Full license texts for all bundled components are included in THIRD-PARTY-NOTICES.md inside the NuGet package.