Skip to content

aspose-pdf/agentic-net-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

245 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aspose.PDF for .NET — Agentic Examples

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.

Overview

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 2648
Categories 34
Target framework net10.0
Aspose.PDF version 26.5.0
Last updated 2026-06-18

For AI Coding Agents

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 2648 examples with metadata
  • MCP-compatible — integrate with any MCP client (Claude Desktop, Cursor, Continue.dev)

Categories

Category Examples Agent Guide
accessibility-and-tagged-pdfs 45 AGENTS.md
basic-operations 57 AGENTS.md
compare-pdf 29 AGENTS.md
conversion 101 AGENTS.md
document 121 AGENTS.md
facades-acroforms 42 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 215 AGENTS.md
facades-extract-images-and-text 85 AGENTS.md
facades-fill-forms 33 AGENTS.md
facades-forms 88 AGENTS.md
facades-metadata 40 AGENTS.md
facades-pages 117 AGENTS.md
facades-secure-documents 40 AGENTS.md
facades-sign-documents 31 AGENTS.md
facades-stamps 49 AGENTS.md
facades-texts-and-images 28 AGENTS.md
facades-xmp-metadata 41 AGENTS.md
graphs-zugferd-operators 82 AGENTS.md
pages 100 AGENTS.md
parse-pdf 64 AGENTS.md
securing-and-signing-pdf 77 AGENTS.md
stamping 50 AGENTS.md
working-with-annotations 157 AGENTS.md
working-with-attachments 50 AGENTS.md
working-with-forms 233 AGENTS.md
working-with-graphs 76 AGENTS.md
working-with-images 70 AGENTS.md
working-with-tables 97 AGENTS.md
working-with-text 75 AGENTS.md
working-with-xml 73 AGENTS.md

Each category contains standalone .cs files that can be compiled and run independently.

Getting Started

Prerequisites

  • .NET SDK (net10.0 or compatible version)
  • Aspose.PDF for .NET NuGet package (26.5.0)
  • Valid Aspose license (for production use)

Running Examples

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.5.0
# Copy the example .cs file as Program.cs
dotnet run

Code Patterns

Loading a PDF

using (Document pdfDoc = new Document("input.pdf"))
{
    // Work with document
}

Error Handling

if (!File.Exists(inputPath))
{
    Console.Error.WriteLine($"Error: File not found - {inputPath}");
    return;
}

try
{
    // Operations
}
catch (Exception ex)
{
    Console.Error.WriteLine($"Error: {ex.Message}");
}

Important Notes

  • One-based indexing: Aspose.PDF uses 1-based page indexing (Pages[1] = first page)
  • Deterministic cleanup: All IDisposable objects wrapped in using blocks
  • Console output: Success/error messages written to Console.WriteLine/Console.Error
  • Fully qualified types: Use Aspose.Pdf.Drawing.Path (not bare Path) to avoid ambiguity with System.IO.Path

Agentic .NET Ecosystem

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

Related Resources

Official Documentation

Downloads & Packages

Community & Support

Licensing & Purchase

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-06-18