Agentic, build-validated C# code examples for Aspose.PDF for .NET covering PDF creation, conversion, editing, annotations, forms, digital signatures, and text extraction. Every example compiles and runs successfully. Includes agents.md guides optimized for AI coding agents.
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 | 2631 |
| Categories | 34 |
| Target framework | net10.0 |
| Aspose.PDF version | 26.4.0 |
| Last updated | 2026-05-08 |
This repository is structured for direct use by AI coding agents and LLM-powered tools:
agents.md— root-level guide covering API surface, anti-patterns, and category tips- Per-category
agents.md— targeted guidance inside each category folder index.json— machine-readable manifest of all 2,631 examples with metadata- MCP-compatible — integrate with any MCP client (Claude Desktop, Cursor, Continue.dev) via the Aspose PDF Examples Generator
| Category | Examples | Agent Guide |
|---|---|---|
accessibility-and-tagged-pdfs |
45 | agents.md |
basic-operations |
56 | agents.md |
compare-pdf |
27 | agents.md |
conversion |
102 | agents.md |
document |
118 | agents.md |
facades-acroforms |
40 | agents.md |
facades-annotations |
106 | agents.md |
facades-bookmarks |
35 | agents.md |
facades-convert-documents |
40 | agents.md |
facades-documents |
101 | agents.md |
facades-edit-document |
209 | agents.md |
facades-extract-images-and-text |
82 | agents.md |
facades-fill-forms |
28 | agents.md |
facades-forms |
90 | agents.md |
facades-metadata |
40 | agents.md |
facades-pages |
117 | agents.md |
facades-secure-documents |
40 | agents.md |
facades-sign-documents |
34 | agents.md |
facades-stamps |
45 | agents.md |
facades-texts-and-images |
27 | agents.md |
facades-xmp-metadata |
43 | agents.md |
graphs-zugferd-operators |
83 | agents.md |
pages |
99 | agents.md |
parse-pdf |
65 | agents.md |
securing-and-signing-pdf |
83 | agents.md |
stamping |
50 | agents.md |
working-with-annotations |
160 | agents.md |
working-with-attachments |
50 | agents.md |
working-with-forms |
239 | agents.md |
working-with-graphs |
70 | agents.md |
working-with-images |
70 | agents.md |
working-with-tables |
91 | agents.md |
working-with-text |
72 | agents.md |
working-with-xml |
74 | agents.md |
- .NET SDK (net10.0 or compatible version)
- Aspose.PDF for .NET NuGet package (26.4.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.4.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
Other Aspose products with agentic, build-validated example repositories:
| Product | Repository | Focus |
|---|---|---|
| Aspose.Words for .NET | aspose-words/agentic-net-examples | Word processing, DOCX, mail merge |
| Aspose.Cells for .NET | aspose-cells/agentic-net-examples | Spreadsheets, Excel, charts |
| Aspose.HTML for .NET | aspose-html/agentic-net-examples | HTML conversion, DOM editing |
| Aspose.Imaging for .NET | aspose-imaging/agentic-net-examples | Image conversion, manipulation |
| Aspose.Slides for .NET | aspose-slides/agentic-net-examples | Presentations, PowerPoint |
| Aspose.Email for .NET | aspose-email/agentic-net-examples | Email, calendars, messaging |
| Aspose.BarCode for .NET | aspose-barcode/agentic-net-examples | Barcode generation and recognition |
- 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-05-08