Aspose.PDF FOSS for .NET is a free, MIT-licensed .NET library for reading, creating, and manipulating PDF documents. Released under a permissive open-source license, it removes the traditional barrier to enterprise-grade PDF capabilities — every feature in the library is available without purchasing a commercial license.

What Is Aspose.PDF FOSS for .NET?

The library targets .NET 8 and later. It is published to NuGet under the package ID Aspose.Pdf.Foss and can be added to any .NET 8+ project with a single command:

dotnet add package Aspose.Pdf.Foss --version 0.1.0-alpha

The primary namespace is Aspose.Pdf, with related namespaces including Aspose.Pdf.Text, Aspose.Pdf.Forms, and Aspose.Pdf.Facades. The library exposes 834 public API classes backed by 7,065 documented claims and 100 code snippets extracted directly from the test suite.

Core Capabilities

The API covers the full lifecycle of a PDF document:

  • Document creation and loadingDocument.Create() produces a blank document; Document.Open(data) loads an existing PDF from a byte array or stream.
  • Page and content access — the Pages collection provides 1-based indexed access to individual pages, each of which exposes annotations, operators, and content streams.
  • Text extractionTextFragmentAbsorber visits a page and collects every text fragment, with optional search-phrase filtering and regular expression support.
  • Interactive actionsPdfAction.CreateUri, PdfAction.CreateGoTo, PdfAction.CreateJavaScript, and PdfAction.CreateLaunch cover the standard PDF action types.
  • AnnotationsAnnotationCollection.AddLinkAnnotation attaches a link annotation with an associated action to any rectangular region on a page.
  • Forms — the Aspose.Pdf.Forms namespace and Aspose.Pdf.Facades provide access to AcroForm fields, appearance formatting, and field-level JavaScript extensions.

The following example demonstrates the round-trip pattern: create a new PDF document, add a URI action link annotation to the first page, save to a stream, and reload to verify the annotation persists.

using var doc = Document.Create();
doc.Pages.Add();
var page = doc.Pages[1];
var action = PdfAction.CreateUri("https://aspose.com");
page.Annotations.AddLinkAnnotation(new Rectangle(50, 700, 200, 720), action);
using var ms = new MemoryStream();
doc.Save(ms);
ms.Position = 0;
using var doc2 = Document.Open(ms.ToArray());
var annot = (LinkAnnotation)doc2.Pages[1].Annotations[1];
Console.WriteLine(annot.Uri); // https://aspose.com

The Document.Open static method accepts a byte[] or a stream. doc.Pages[1] accesses the first page by 1-based index — the same index convention used throughout the library. After saving to a MemoryStream, the document can be reloaded and all annotations are preserved.


Searching Text on a Page

TextFragmentAbsorber provides keyword search over the content stream of any page. Pass a search phrase to the constructor to restrict results, or use the no-argument overload to collect all fragments:

using var doc = Document.Open("path/to/document.pdf");
var absorber = new TextFragmentAbsorber("Hello");
absorber.Visit(doc.Pages[1]);
foreach (var fragment in absorber.TextFragments)
{
    Console.WriteLine($"Found: {fragment.Text}");
}

Each TextFragment in the resulting collection exposes properties including Text, FontSize, and positional data, making it straightforward to build search, highlight, or redaction workflows on top of the extracted fragments.


MIT License and Open Development

All source code is published on GitHub and distributed under the MIT License. There is no evaluation watermark, no usage limit, and no separate license file to manage. The Document.IsLicensed property always returns true in the FOSS build.

The package is currently at version 0.1.0-alpha, reflecting active development. The API surface is already substantial — 834 classes, 7,065 claims — and the alpha designation signals that API signatures may evolve before the 1.0 release.


Getting Started