Skip to content

aspose-pdf/agentic-net-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

242 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 2631
Categories 34
Target framework net10.0
Aspose.PDF version 26.4.0
Last updated 2026-05-08

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 2,631 examples with metadata
  • MCP-compatible — integrate with any MCP client (Claude Desktop, Cursor, Continue.dev) via the Aspose PDF Examples Generator

Categories

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

Getting Started

Prerequisites

  • .NET SDK (net10.0 or compatible version)
  • Aspose.PDF for .NET NuGet package (26.4.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.4.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-05-08