Net4x.iTextSharp.Common 6.1.0.26251

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

Net4x.iTextSharp.Common

An SDK-style, multi-targeted repackaging of iTextSharp 5.5.13.3 — the classic .NET port of the Java iText PDF library — so that the same PDF code can be shared between .NET Framework 4.0/4.5 and .NET Standard 2.0 projects.

The public API is the original one: everything still lives under the iTextSharp.text.* namespaces, so existing iTextSharp 5.x code compiles unchanged.

Package id Net4x.iTextSharp.Common
Assembly Net4x.iTextSharp.dll (strong-named)
Target frameworks net40, net45, netstandard2.0
Root namespace iTextSharp
Upstream version iTextSharp 5.5.13.3

Installing

dotnet add package Net4x.iTextSharp.Common

For PDF/A output, add Net4x.iTextSharp.Pdfa as well.

Quick start

Create a document:

using iTextSharp.text;
using iTextSharp.text.pdf;

using var output = new FileStream("hello.pdf", FileMode.Create);
var document = new Document(PageSize.A4, 36, 36, 36, 36);
PdfWriter.GetInstance(document, output);

document.AddTitle("Hello");
document.Open();
document.Add(new Paragraph("Hello, world."));
document.Close();

Read text back out of one:

using iTextSharp.text.pdf;
using iTextSharp.text.pdf.parser;

var reader = new PdfReader("hello.pdf");
try
{
    for (var page = 1; page <= reader.NumberOfPages; page++)
        Console.WriteLine(PdfTextExtractor.GetTextFromPage(reader, page));
}
finally
{
    reader.Close();
}

Stamp an existing document:

var reader = new PdfReader(source);
var stamper = new PdfStamper(reader, output);
var canvas = stamper.GetOverContent(1);
var font = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED);

canvas.BeginText();
canvas.SetFontAndSize(font, 36);
canvas.SetTextMatrix(120, 400);
canvas.ShowText("DRAFT");
canvas.EndText();

stamper.Close();
reader.Close();

Merge documents:

var document = new Document();
var copy = new PdfCopy(document, output);
document.Open();

foreach (var file in files)
{
    var reader = new PdfReader(file);
    for (var page = 1; page <= reader.NumberOfPages; page++)
        copy.AddPage(copy.GetImportedPage(reader, page));
    copy.FreeReader(reader);
    reader.Close();
}

document.Close();

What is in the box

  • Document model — Document, Paragraph, Phrase, Chunk, List, Chapter, Section, Image, Anchor.
  • Layout — PdfPTable / PdfPCell, ColumnText, page events (PdfPageEventHelper), headers, footers and watermarks through PdfWriter.DirectContent.
  • Reading and editing — PdfReader, PdfStamper (including append mode), PdfCopy, PdfSmartCopy, page selection, bookmarks (SimpleBookmark), page labels.
  • Content parsing — PdfTextExtractor with SimpleTextExtractionStrategy, LocationTextExtractionStrategy, region and marked-content filters, image extraction, path and clipping callbacks (IExtRenderListener).
  • Forms — AcroFields, TextField, RadioCheckField, PushbuttonField, form flattening.
  • Security — RC4 40/128, AES‑128 and AES‑256 encryption, permissions, digital signatures (MakeSignature, PdfPKCS7), OCSP/CRL/timestamp clients. Cryptography is provided by Portable.BouncyCastle.
  • Barcodes — Code 39/128, EAN‑8/13, UPC, Interleaved 2 of 5, Codabar, POSTNET, PDF417, Data Matrix and QR (BarcodeQRCode).
  • Fonts — the standard 14 fonts, TrueType/OpenType/Type 1 embedding, FontFactory, FontSelector, WinAnsi / MacRoman / Identity‑H encodings.
  • HTML — the legacy HTMLWorker simple parser with StyleSheet support.
  • Metadata — the full XMP toolkit under iTextSharp.xmp.

Dependencies

Package Applies to
Portable.BouncyCastle 1.9.0 all targets
System.Security.Cryptography.Xml 7.0.1 netstandard2.0
System.Drawing.Common 8.0.0 netstandard2.0

On net40 / net45 the framework's own System.Drawing and System.Security assemblies are used.

System.Drawing.Common 8.0 is Windows-only. On .NET Standard 2.0 consumers running on Linux or macOS, the parts of the API that convert to and from System.Drawing.Image are unavailable; everything that works on raw bytes (Image.GetInstance(byte[]), PNG/JPEG/GIF/TIFF decoding, barcode GetImage()) works everywhere.

Notes on behaviour

A few points regularly surprise newcomers, and they are inherited from upstream iText:

  • new Rectangle(x1, y1, x2, y2) stores the coordinates as given; call Normalize() if the corners may arrive in the wrong order.
  • Rectangle.Rotate() marks the rectangle rotated; the written /MediaBox stays portrait and the orientation is carried by /Rotate, so read it back with GetPageSizeWithRotation.
  • Font.CompareTo returns a difference code (0 equal, 1 family, 2 size, 3 style, 4 colour), not an ordering.
  • Phrase.Add(Chunk) merges adjacent attribute-free chunks that share a font.
  • FontFactory.GetFont(name, size, Font.BOLD) resolves to the bold face and clears the style bit; only styles iText draws itself (underline, strike-through) stay on the Font.
  • Always Close() a PdfReader, and read image bytes (PdfImageObject.GetImageAsBytes()) before you do.

Licence

iText 5 / iTextSharp is licensed under the GNU Affero General Public License v3 with the additional terms in iTextSharp/text/LICENSE.txt. In particular, AGPL section 7(b) requires that the iText producer line is retained in every PDF the library creates or manipulates. If you cannot comply with the AGPL you must obtain a commercial licence from iText Group NV.

Copyright © 1998‑2022 iText Group NV. This package only repackages that work; it is not affiliated with or endorsed by iText Group NV.

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 net40 is compatible.  net403 was computed.  net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Net4x.iTextSharp.Common:

Package Downloads
Net4x.iTextSharp.Pdfa

PDFA functionality for iTextSharp, a free PDF library ported from Java iText.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
6.1.0.26251 185 9/10/2026
6.1.0 467 4/4/2025