PDFtoImage.Parallel 1.0.0-preview

This is a prerelease version of PDFtoImage.Parallel.
dotnet add package PDFtoImage.Parallel --version 1.0.0-preview
                    
NuGet\Install-Package PDFtoImage.Parallel -Version 1.0.0-preview
                    
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="PDFtoImage.Parallel" Version="1.0.0-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PDFtoImage.Parallel" Version="1.0.0-preview" />
                    
Directory.Packages.props
<PackageReference Include="PDFtoImage.Parallel" />
                    
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 PDFtoImage.Parallel --version 1.0.0-preview
                    
#r "nuget: PDFtoImage.Parallel, 1.0.0-preview"
                    
#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 PDFtoImage.Parallel@1.0.0-preview
                    
#: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=PDFtoImage.Parallel&version=1.0.0-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=PDFtoImage.Parallel&version=1.0.0-preview&prerelease
                    
Install as a Cake Tool

PDFtoImage.Parallel Logo PDFtoImage.Parallel

NuGet version NuGet downloads GitHub license

True parallel PDF rendering for PDFtoImage by distributing PDFium work across isolated worker processes.

PDFium is not thread-safe, so the main PDFtoImage package serializes access to it inside a process. PDFtoImage.Parallel creates multiple worker processes instead, allowing pages and independent PDFs to be rendered concurrently.

Requirements

  • .NET 11 or later
  • Windows 10 or later / Windows Server 2016 or later / Linux (glibc or musl) / macOS 14 or later
  • Ability to launch child processes and use local pipes

Getting started

Create one ParallelPdfProcessor and reuse it for multiple conversions:

await using var converter = new PDFtoImage.Parallel.ParallelPdfProcessor();

using var image = await converter.ToImageAsync(
    File.OpenRead("document.pdf"),
    page: 0);

The same pool can serve concurrent requests for different PDFs:

await using var converter = new PDFtoImage.Parallel.ParallelPdfProcessor();

var first = converter.ToImageAsync(File.OpenRead("a.pdf"), 0);
var second = converter.ToImageAsync(File.OpenRead("b.pdf"), 0);

using var imageA = await first;
using var imageB = await second;

To render multiple pages while receiving them in the requested order:

await using var converter = new PDFtoImage.Parallel.ParallelPdfProcessor();

await foreach (var image in converter.ToImagesAsync(File.OpenRead("document.pdf")))
{
    using (image)
    {
        // process the page
    }
}

Dispose returned SKBitmap instances after use. To save one, use SKBitmap.Encode.

ASP.NET Core dependency injection

Register one processor as a singleton so requests share its worker pool:

builder.Services.AddSingleton(_ => new PDFtoImage.Parallel.ParallelPdfProcessor(workerCount: 4));

Omitting workerCount or passing null uses Environment.ProcessorCount.

Technical considerations

Worker pool and lifetime

Workers start on demand and are reused until the processor is disposed. Set workerCount to control the pool size.

Cancellation or a worker failure does not prevent later requests. Workers also exit if the parent process stops.

Single-worker fault isolation

Using workerCount: 1 does not provide parallel rendering, but still runs PDFium out of process. This can be useful when isolating the host application from native worker failures (e.g. a PDFium process crash) is more important than parallel throughput.

Worker process isolation can protect the host from native PDFium crashes, but it is not a security sandbox. Workers normally run with the same user security context as the host application.

Deployment

Framework-dependent, self-contained, trimmed single-file, and Native AOT applications are supported.

Memory

The processor buffers each PDF in memory, and workers may load additional copies. Large PDFs and concurrent requests can use substantial memory.

PDF data and rendered bitmaps must each fit in a 1 GiB IPC message, including protocol metadata.

Worker bootstrap

No separate worker executable is deployed. PDFtoImage.Parallel re-launches the consuming application and enters worker mode before Main. CoreCLR uses a startup hook, so System.StartupHookProvider.IsSupported must not be explicitly disabled; the package explicitly re-enables startup-hook support for trimmed CoreCLR publishes. Native AOT uses a module initializer instead.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview 30 9/28/2026

- Initial release for .NET 11 with parallel PDF rendering through isolated worker processes on Windows, Linux and macOS.
- Added reusable worker pools, ordered page results and automatic worker cleanup.
- Supports self-contained, trimmed single-file and Native AOT applications.