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
<PackageReference Include="Soenneker.Pdfs.Processor" Version="4.0.27" />
<PackageVersion Include="Soenneker.Pdfs.Processor" Version="4.0.27" />
<PackageReference Include="Soenneker.Pdfs.Processor" />
paket add Soenneker.Pdfs.Processor --version 4.0.27
#r "nuget: Soenneker.Pdfs.Processor, 4.0.27"
#:package Soenneker.Pdfs.Processor@4.0.27
#addin nuget:?package=Soenneker.Pdfs.Processor&version=4.0.27
#tool nuget:?package=Soenneker.Pdfs.Processor&version=4.0.27
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 | Versions 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. |
-
net10.0
- Newtonsoft.Json (>= 13.0.4)
- Soenneker.Utils.File (>= 4.0.2273)
- Soenneker.Utils.Path (>= 4.0.1233)
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 |