Soenneker.Pdfs.Processor 4.0.27

Prefix Reserved
dotnet add package Soenneker.Pdfs.Processor --version 4.0.27
                    
NuGet\Install-Package Soenneker.Pdfs.Processor -Version 4.0.27
                    
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="Soenneker.Pdfs.Processor" Version="4.0.27" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Pdfs.Processor" Version="4.0.27" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Pdfs.Processor" />
                    
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 Soenneker.Pdfs.Processor --version 4.0.27
                    
#r "nuget: Soenneker.Pdfs.Processor, 4.0.27"
                    
#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 Soenneker.Pdfs.Processor@4.0.27
                    
#: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=Soenneker.Pdfs.Processor&version=4.0.27
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Pdfs.Processor&version=4.0.27
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Pdfs.Processor

A fast .NET utility for replacing text, merging, cleaning, and optimizing PDF documents.

Installation

dotnet add package Soenneker.Pdfs.Processor

Registration

services.AddPdfProcessorAsSingleton();

Replace text without changing its font operators

PdfProcessResult result = await processor.ReplaceTextFile(
    "template.pdf",
    "completed.pdf",
    [
        new PdfTextReplacement
        {
            Search = "{{CustomerName}}",
            Replacement = "Jane Smith"
        }
    ],
    new PdfReplaceOptions
    {
        RequireAll = true,
        Output = new PdfOutputOptions
        {
            Compression = PdfCompressionProfile.Maximum
        }
    });

Replacement modifies supported PDF text-showing operands directly. The surrounding font, size, color, spacing, transform operators, and TJ positioning values are retained. Matches can span multiple string fragments within one text-showing operation, which handles the kerning-based fragmentation commonly produced by PDF writers. They can also span consecutive Tj/TJ operations when no positioning or graphics-state operator intervenes. Set MatchAcrossTextFragments or MatchAcrossTextOperators to false for stricter matching.

Custom/subset font encodings may not contain every replacement glyph, and matches never cross an intervening operator because it can represent a visual space, line break, font change, or transform. Inspect PdfProcessResult.Replacements, including CrossFragmentReplacementCount, to confirm each requested change.

Merge pages structurally

await processor.Merge(
[
    new PdfMergeSource { Stream = cover },
    new PdfMergeSource { Stream = body, StartPage = 2, EndPage = 8 }
], destination);

Pages and their PDF resources are imported without rasterization.

Clean and optimize

await processor.OptimizeFile(
    "input.pdf",
    "clean.pdf",
    new PdfOutputOptions
    {
        Compression = PdfCompressionProfile.Maximum,
        RemoveMetadata = true,
        RemoveEmbeddedFiles = true,
        RemoveJavaScriptAndActions = true
    });

Compression profiles are lossless. Cleanup can independently remove metadata, annotations, embedded files, JavaScript, and automatic actions.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
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
4.0.27 0 9/15/2026
4.0.26 42 9/13/2026
4.0.23 48 9/12/2026
4.0.22 47 9/12/2026
4.0.21 57 9/9/2026
4.0.20 74 9/9/2026
4.0.19 80 9/8/2026
4.0.18 82 9/8/2026
4.0.17 97 9/8/2026
4.0.16 94 9/7/2026
4.0.15 102 9/7/2026
4.0.14 90 9/7/2026
4.0.13 87 9/7/2026
4.0.12 101 9/4/2026
4.0.11 89 9/4/2026
4.0.10 97 9/4/2026
4.0.9 88 9/4/2026
4.0.7 96 9/4/2026
4.0.6 91 9/4/2026
4.0.5 86 9/1/2026
Loading failed