PDFix.SDK 10.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package PDFix.SDK --version 10.0.0
                    
NuGet\Install-Package PDFix.SDK -Version 10.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PDFix.SDK" Version="10.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PDFix.SDK" Version="10.0.0" />
                    
Directory.Packages.props
<PackageReference Include="PDFix.SDK" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PDFix.SDK --version 10.0.0
                    
#r "nuget: PDFix.SDK, 10.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PDFix.SDK@10.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PDFix.SDK&version=10.0.0
                    
Install as a Cake Addin
#tool nuget:?package=PDFix.SDK&version=10.0.0
                    
Install as a Cake Tool

PDFix SDK

keywords: pdf, accessibility, remediation, extraction, html, conversion, render, watermark, redact, sign, forms

PDFix SDK analyses the key components of the PDF and makes it easily available for you to manipulate. It's a high-performance library that helps software developers and end-users integrate PDF functionality into their workflows.

Features

  • Make PDF Accessible
  • Automated PDF tagging and remediation (PDF/UA, WCAG)
  • Content extraction to JSON and XML
  • PDF to HTML conversion
  • Rendering, redaction, forms, comments, and digital signatures

Change log

https://pdfix.net/support/changelog/

Supported platforms

Native libraries shipped in this package:

  • Linux x64, arm64
  • Windows x64
  • macOS x64, arm64

Target frameworks: .NET Framework 4.8+ and .NET 6+ (managed assembly is .NET Standard 2.0).

Installation

dotnet add package PDFix.SDK

Example

using System;
using PDFixSDK.Pdfix;

// Typical pattern: one Pdfix per process. Dispose()/Destroy() release native
// objects for this session; they do not unload pdf.dll from the process.
using (var pdfix = new Pdfix())
{
    using (var doc = pdfix.OpenDoc("input.pdf", ""))
    {
        Console.WriteLine("Pages: " + doc.GetNumPages());
    }
    // Exiting the pdfix using block calls Dispose() → Destroy() on the root
    // Pdfix instance. The native library remains loaded until process exit.
}

PdfDoc, Pdfix, and other owned wrappers implement IDisposable. Calling Dispose() (or exiting a using block) runs the correct native lifecycle method for that type (Close, Destroy, or Release). You can still call Close() / Destroy() explicitly if you prefer.

Process lifetime: Pdfix.Destroy() (or Dispose() on Pdfix) tears down open documents and native SDK state for the current session. It does not unload pdf.dll / libpdf.so / libpdf.dylib from the process. The native library stays loaded until the host process exits. Plan for one SDK init per process in long-running services, plugins, or app domains — not repeated full unload/reload cycles. Short demos and CLI-style apps match this model; Release() on borrowed handles (for example pages from AcquirePage()) only drops that borrow and is unrelated to unloading the DLL.

More examples

https://github.com/pdfix/pdfix_sdk_example_dotnet

.NET deployment (managed + native)

The NuGet package contains:

  • PDFix.SDK.dll — managed .NET Standard 2.0 assembly (works on .NET Framework 4.8+ and .NET Core / .NET 5+).
  • pdf.dll and LicenseSpringVMD.dll (Windows) — native libraries, copied to your build output by MSBuild targets in the package.
  • libpdf.so / libpdf.dylib (Linux / macOS) — copied under x64/ or arm64/ in the output directory (or flat on Windows).

Native library layout

MSBuild targets (PDFix.SDK.targets) copy the runtime matching your build machine into the output folder. At runtime, NativeMethods resolves natives relative to the managed assembly directory, in this order:

  1. {output}/{file} — flat layout (Windows default from package targets)
  2. {output}/runtimes/{rid}/native/{file} — standard NuGet RID layout
  3. {output}/{x64|arm64|x86}/{file} — legacy layout

On Windows x64, LicenseSpringVMD.dll is preloaded before pdf.dll.

For .NET Framework 4.8, use x64 PlatformTarget (or Any CPU with the package targets, which default to win-x64 native assets). After build, pdf.dll must be loadable from the application output directory.

OnBase / custom hosts: register the managed PDFix.SDK.dll; deploy native pdf.dll separately per your host's rules. Native pdf.dll is not a .NET assembly.

Wrapper behavior (9.1+)

Process lifetime and native library unload

  • Pdfix exposes Destroy(), not a root-level Release(). Dispose() on Pdfix calls Destroy().
  • Destroy() closes owned native resources (documents, streams, internal pdfium modules) for the current session. Under the hood this does not perform a full process reset and does not call FreeLibrary / dlclose on the PDFix native DLL.
  • pdf.dll / libpdf.so / libpdf.dylib remain loaded for the lifetime of the process once initialized (including after explicit Destroy()).
  • Borrowed handles — AcquirePage() and similar — use Release() only to return that borrow; it does not unload the SDK.
  • Recommended usage: one Pdfix init per process; use using / Dispose() on owned wrappers (PdfDoc, streams, …) within that session. Suitable for short samples, batch tools, and single-run workers. Not for hosts that require repeated SDK unload and clean reload in the same process without exiting.

Handle map

For types returned from the SDK (for example GetProgressControl()), the wrapper returns one managed instance per native handle. Repeated calls with the same native pointer return the same C# object.

Borrowed handles (for example AcquirePage() until Release()) get a new wrapper after release — do not assume reference equality across borrow cycles.

Callbacks and client data

RegisterEvent, UnregisterEvent, and SetCancelProc accept managed client data as object. The wrapper pins delegates and client data for as long as the native registration is active; you do not pass GCHandle or IntPtr for new code.

progress.SetCancelProc(
    data => (data as string) == "my-token" ? 0 : -1,
    "my-token");

pdfix.RegisterEvent(PdfEventType.kEventProgressDidChange, OnProgress, null);
// ...
pdfix.UnregisterEvent(PdfEventType.kEventProgressDidChange, OnProgress, null);

Pass the same delegate and client data to UnregisterEvent that you used for RegisterEvent.

Breaking changes from 9.0.x

  • RegisterEvent / UnregisterEvent client-data parameters are object, not IntPtr. Update call sites that passed IntPtr.Zero to null.
  • Wrapper types implement IDisposable; prefer using for owned objects.
  • Duplicate managed wrappers are deduplicated by native handle (see Handle map above).

Local NuGet matrix tests

./commands/build_nuget.sh
# ensure release/nuget/*.nupkg exists (CI copies from include/nuget)
./commands/test_nuget_matrix.sh linux --tfms=net10.0,net9.0,net8.0,net6.0
# Windows:
./commands/test_nuget_matrix.ps1 -Tfms net48,net8.0

PdfixNugetSmoke copies fixtures/test.pdf to the build output; matrix scripts verify it is present before run. Override with PDFIX_SMOKE_PDF or --pdf=path. Optional license (from env.sh / env.ps1 when set): PDFIX_LICENSE_KEY, and PDFIX_LICENSE_EMAIL for account auth (email + key); key-only uses standard activation.

CI (bitbucket-pipelines.yml): Linux matrix (net6.0–net10.0) and Windows self-hosted smoke (net48, net6.0) via test-win-dotnet.ps1. External pdfix_sdk_example_dotnet Docker steps remain defined but disabled until enabled later.

Testing a local package (Windows)

After commands/build_nuget.sh and copying packages to release/nuget/:

On the host (no Docker):

.\commands\test-win-dotnet.ps1

Direct C# wrapper smoke (links generated Pdfix.cs from the repo, not the NuGet package):

.\commands\smoketest_cs_direct.ps1

Requires a built Windows x64 SDK (bin/x86_64/pdf.dll) and PDFIX_LICENSE_EMAIL / PDFIX_LICENSE_KEY for licensed samples.

In a Windows container (same as CI test-nuget-package-win-*):

  • git on the host clones the example repo; the container only restores, builds, and runs.
  • Mounts: release\nuget → C:\nuget, cloned example → C:\example (writable; restore needs obj/).
  • Requires Docker Desktop in Windows containers mode and a working docker version.
.\commands\test-win-dotnet-docker.ps1 -Tfm net48
.\commands\test-win-dotnet-docker.ps1 -Tfm net6.0 -NuGetHostDir release\nuget
.\commands\test-win-dotnet-docker.ps1 -Tfm net8.0 -NuGetHostDir D:\test-packages\nuget

Supported -Tfm values: net10.0, net9.0, net8.0, net6.0, net48.

If docker fails with localhost:2375 connection refused, the host script clears a stale DOCKER_HOST automatically. If it still fails: ensure Docker Desktop is running, switch to Windows containers, and remove any machine-level DOCKER_HOST=tcp://localhost:2375 from System Environment Variables.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on PDFix.SDK:

Package Downloads
PDFix.OcrTesseract

~ OCR Tesseeract plugin for PDFix.SDK ~ - OCR PDF document, page a portion of a page - embed fonts into the document Free trial: https://pdfix.net/download Code samples: http://pdfix.net/docs/_c_s__samples.html Related packages: PDFix.SDK ~ https://www.nuget.org/packages/PDFix.SDK/ PDFix.PdfToHtml ~ https://www.nuget.org/packages/PDFix.PdfToHtml/

PDFix.PdfToHtml

~ PDF to HTML plugin for PDFix.SDK ~ Convert PDF document or single page to HTML. Create embeddable HTML div element. Fixed Original Layout - retain visual appearance of the page content - convert PDF Form to HTML Form PDF to Responsive HTML - create PDF content reflow Free trial: https://pdfix.net/download Code samples: http://pdfix.net/docs/_c_s__samples.html Related packages: PDFix.SDK ~ https://www.nuget.org/packages/PDFix.SDK/ PDFix.OcrTesseract ~ https://www.nuget.org/packages/PDFix.OcrTesseract/

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.1 48 11/25/2026
10.0.0 107 11/18/2026
9.3.0 375 8/31/2026
9.2.0 268 8/13/2026
9.1.1 207 7/16/2026
9.1.0 533 6/23/2026
9.0.0 2,634 5/4/2026
8.8.0 770 4/29/2026
8.7.9 807 12/30/2025
8.7.8 459 12/17/2025
8.7.7 441 12/17/2025
8.7.6 2,302 10/16/2025
8.7.5 424 10/9/2025
8.7.4 565 9/5/2025
8.7.3 371 8/14/2025
8.7.2 1,076 7/20/2025
8.7.1 736 7/10/2025
8.7.0 418 6/23/2025
8.6.1 402 6/16/2025
8.6.0 424 6/5/2025
Loading failed