AI-friendly repository containing validated C# examples for Aspose.PDF for .NET API.
This repository provides working code examples demonstrating Aspose.PDF for .NET capabilities. All examples are automatically generated, compiled, and validated using the Aspose.PDF Examples Generator.
| Metric | Value |
|---|---|
| Total examples | 2708 |
| Categories | 34 |
| Target framework | net10.0 |
| Aspose.PDF version | 26.3.0 |
| Last updated | 2026-04-10 |
Examples are organized by feature category:
accessibility-and-tagged-pdfs/- 45 example(s)basic-operations/- 57 example(s)compare-pdf/- 28 example(s)conversion/- 102 example(s)document/- 122 example(s)facades-acroforms/- 41 example(s)facades-annotations/- 107 example(s)facades-bookmarks/- 35 example(s)facades-convert-documents/- 40 example(s)facades-documents/- 101 example(s)facades-edit-document/- 214 example(s)facades-extract-images-and-text/- 83 example(s)facades-fill-forms/- 35 example(s)facades-forms/- 88 example(s)facades-metadata/- 40 example(s)facades-pages/- 117 example(s)facades-secure-documents/- 40 example(s)facades-sign-documents/- 35 example(s)facades-stamps/- 50 example(s)facades-texts-and-images/- 29 example(s)facades-xmp-metadata/- 45 example(s)graphs-zugferd-operators/- 84 example(s)pages/- 99 example(s)parse-pdf/- 65 example(s)securing-and-signing-pdf/- 87 example(s)stamping/- 50 example(s)working-with-annotations/- 163 example(s)working-with-attachments/- 50 example(s)working-with-forms/- 240 example(s)working-with-graphs/- 85 example(s)working-with-images/- 72 example(s)working-with-tables/- 109 example(s)working-with-text/- 75 example(s)working-with-xml/- 75 example(s)
Each category contains standalone .cs files that can be compiled and run independently.
- .NET SDK (net10.0 or compatible version)
- Aspose.PDF for .NET NuGet package (26.3.0)
- Valid Aspose license (for production use)
Each example is a self-contained C# file. To run an example:
cd <CategoryFolder>
dotnet new console -o ExampleProject
cd ExampleProject
dotnet add package Aspose.PDF --version 26.3.0
# Copy the example .cs file as Program.cs
dotnet runusing (Document pdfDoc = new Document("input.pdf"))
{
// Work with document
}if (!File.Exists(inputPath))
{
Console.Error.WriteLine($"Error: File not found - {inputPath}");
return;
}
try
{
// Operations
}
catch (Exception ex)
{
Console.Error.WriteLine($"Error: {ex.Message}");
}- One-based indexing: Aspose.PDF uses 1-based page indexing (
Pages[1]= first page) - Deterministic cleanup: All IDisposable objects wrapped in
usingblocks - Console output: Success/error messages written to Console.WriteLine/Console.Error
- Fully qualified types: Use
Aspose.Pdf.Drawing.Path(not barePath) to avoid ambiguity withSystem.IO.Path
- Each category folder contains an
agents.mdwith category-specific guidance - Each category folder contains an
index.jsonwith per-example metadata - Root
agents.mdprovides cumulative guidance across all categories - Root
index.jsonprovides a machine-readable manifest of all examples
- Aspose.PDF for .NET Documentation — Guides, tutorials, and feature overviews
- API Reference — Complete class/method reference
- Release Notes — Version history and changelogs
- NuGet Package — Install via
dotnet add package Aspose.PDF - Direct Downloads — MSI/ZIP installers and DLLs
- Aspose.PDF Forum — Community Q&A and official support
- Aspose Blog - PDF — Tutorials, tips, and product updates
- GitHub Issues — Bug reports and feature requests
- Purchase — Commercial license options
- Temporary License — Full-feature evaluation license
All examples use Aspose.PDF for .NET and require a valid license for production use. See licensing options.
This repository is maintained by automated code generation. For AI-friendly guidance, see agents.md. Last updated: 2026-04-10