agentleFS
aspose-pdfaspose-pdf/agentic-net-examples/document/AGENTS.md

agentic-net-examples / document

AGENTS.md2 starsChanged 4 months agoMITView on GitHub

C# examples for document using Aspose.PDF for .NET

31 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this AGENTS.md into the rules it gives an agent

5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 30 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create MarkdownSaveOptions with parameterless constructor: new MarkdownSaveOptions().

    line 122
  2. Distinctive:

    Create Matrix3D with parameterless constructor: new Matrix3D().

    line 125
  3. Distinctive:

    Create Matrix3D with: new Matrix3D(double[] matrix3DArray).

    line 126
  4. Distinctive:

    Ensure the output file extension matches the format when using MarkdownSaveOptions.

    line 129
  5. Distinctive:

    Ensure the output file extension matches the format when using SaveOptions.

    line 130

“Common” is measured: kept by at least 6 in 10 of the 30 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS - document

Document in PDF using C# / .NET -- 120 verified, compile-tested examples for Aspose.PDF for .NET 26.8.0. Each .cs file is a standalone, build-validated console example, generated and runtime-checked by an AI agent before publishing.

Persona

You are a C# developer specializing in PDF processing using Aspose.PDF for .NET, working within the document category. This folder contains standalone C# examples for document operations. See the root agents.md for repository-wide conventions and boundaries.

Scope

  • This folder contains examples for document.
  • Files are standalone .cs examples stored directly in this folder.

Required Namespaces

  • using Aspose.Pdf; (120/120 files) ← category-specific
  • using Aspose.Pdf.Text; (33/120 files)
  • using Aspose.Pdf.Annotations; (23/120 files)
  • using Aspose.Pdf.Forms; (12/120 files)
  • using Aspose.Pdf.Optimization; (7/120 files)
  • using Aspose.Pdf.Tagged; (7/120 files)
  • using Aspose.Pdf.LogicalStructure; (6/120 files)
  • using Aspose.Pdf.Devices; (5/120 files)
  • using Aspose.Pdf.Drawing; (3/120 files)
  • using Aspose.Pdf.Facades; (2/120 files)
  • using Aspose.Pdf.Multithreading; (1/120 files)
  • using Aspose.Pdf.Security.HiddenDataSanitization; (1/120 files)
  • using System; (120/120 files)
  • using System.IO; (101/120 files)
  • using System.Collections.Generic; (3/120 files)
  • using System.Data; (2/120 files)
  • using System.Diagnostics; (2/120 files)
  • using System.Drawing; (2/120 files)
  • using System.Text; (2/120 files)
  • using NUnit.Framework; (1/120 files)
  • using System.Linq; (1/120 files)
  • using System.Reflection; (1/120 files)
  • using System.Threading; (1/120 files)
  • using System.Threading.Tasks; (1/120 files)

Common Code Pattern

Most files follow this pattern:

using (Document doc = new Document("input.pdf"))
{
    // ... operations ...
    doc.Save("output.pdf");
}

Files in this folder

FileTitleKey APIsDescription
add-accessibility-tags-to-pdfAdd Accessibility Tags to PDF (Headings, Paragraphs, Tables)Document, ITaggedContent, StructureElementLoads an existing PDF, enables auto‑tagging, sets language and title metadata, and creates tagged...
add-background-color-to-pdf-pageAdd Background Color to PDF Page with OpacityDocument, Page, GraphDemonstrates how to fill an entire PDF page with a semi‑transparent color by adding a rectangle s...
add-background-template-to-pdf-pagesAdd Background Template to All PDF PagesDocument, Page, PdfPageStampShows how to load a PDF and a single‑page background template, then stamp each page of the target...
add-captions-below-images-in-pdfAdd Captions Below Images in PDFDocument, Page, XImageShows how to iterate over image resources in a PDF and insert a styled caption paragraph beneath ...
add-checked-checkbox-form-fieldAdd Checked Checkbox Form Field to PDFDocument, Page, RectangleShows how to create a PDF document, add a checkbox form field, set its default state to checked, ...
add-company-logo-header-to-pdf-pagesAdd Company Logo Header to PDF PagesDocument, Page, ImageStampShows how to load an existing PDF, create an ImageStamp for a logo, position it as a top‑center h...
add-custom-document-info-and-xmp-metadataAdd Custom Document Info and XMP Metadata to PDFDocument, DocumentInfo, AddDemonstrates how to add custom key/value pairs to a PDF's DocumentInfo dictionary and embed XMP m...
add-diagonal-text-stamp-to-pdfAdd Diagonal Text Stamp Watermark to PDFDocument, TextStamp, FontRepositoryShows how to load a PDF with Aspose.Pdf, create a TextStamp with a custom message, configure its ...
add-digital-signature-to-pdfAdd Digital Signature Field and Sign PDF with Self‑Signed Ce...Document, Rectangle, SignatureFieldDemonstrates how to create a signature field in a PDF, configure a PKCS#1 signature using a self‑...
add-dynamic-heading-to-pdfAdd Dynamic Heading to PDFDocument, Page, HeadingShows how to load a PDF template, create a heading with dynamic date and user information, positi...
add-hierarchical-numbered-headingsAdd Hierarchical Numbered Headings to PDFDocument, Page, HeadingShows how to apply decimal numbering to headings and create hierarchical numbering (chapters and ...
add-hyperlink-annotation-to-pdfAdd Hyperlink Annotation to PDFDocument, Page, RectangleShows how to insert a clickable hyperlink annotation that opens an external website in a PDF docu...
add-indented-paragraph-with-line-spacingAdd Indented Paragraph with Line Spacing to PDFDocument, Page, TextParagraphShows how to load a PDF, create a TextParagraph with first‑line and subsequent line indentation, ...
add-javascript-open-action-to-pdfAdd JavaScript Open Action to PDFDocument, Save, JavascriptActionDemonstrates embedding JavaScript in a PDF with Aspose.Pdf so an alert dialog appears when the do...
add-javascript-sum-calculation-to-pdf-formCalculate Sum of Two PDF Form Fields with JavaScriptDocument, Page, NumberFieldDemonstrates creating a PDF with two numeric input fields and a read‑only sum field, then attachi...
add-javascript-sum-numeric-pdf-form-fieldsAdd JavaScript to Sum Numeric PDF Form FieldsDocument, Form, TextBoxFieldDemonstrates embedding Acrobat JavaScript in a PDF with Aspose.Pdf to calculate the total of two ...
add-level-1-heading-to-pdfAdd Level 1 Heading to PDF using Tagged ContentDocument, ITaggedContent, HeaderElementDemonstrates how to create a PDF document, use the tagged content API to insert a Level 1 heading...
add-line-annotation-with-custom-color-thicknessAdd Line Annotation with Custom Color and Thickness to PDFDocument, Page, RectangleDemonstrates how to create a line annotation on a PDF page, set its color, and adjust its thickne...
add-line-separator-annotation-to-pdf-pageAdd Line Separator Annotation to PDF PageDocument, Page, PointDemonstrates how to insert a horizontal line annotation as a visual separator on a specific PDF p...
add-link-annotation-open-pdf-attachmentAdd Link Annotation to Open PDF AttachmentDocument, Page, RectangleShows how to create a link annotation on a PDF page that opens an external PDF attachment using A...
add-multi-level-toc-to-pdfAdd Multi‑Level Table of Contents to PDFDocument, AutoTaggingSettings, ProcessParagraphsDemonstrates how to enable auto‑tagging, detect headings, create a TOC element, insert a dedicate...
add-new-bookmark-to-pdf-outlineAdd New Bookmark to PDF OutlineDocument, OutlineItemCollection, XYZExplicitDestinationDemonstrates how to create an outline (bookmark) in an existing PDF, set its title, style, and de...
add-page-count-footer-to-pdfAdd Page Count Footer to PDF PagesDocument, Page, TextFragmentDemonstrates how to add a custom footer that shows "Page X of Y" on each page of a PDF using Aspo...
add-page-numbers-to-pdf-footerAdd Page Numbers to PDF FooterDocument, Page, PageNumberStampDemonstrates how to insert sequential page numbers into the footer of each page in a PDF using As...
add-popup-note-annotationAdd Pop‑up Note Annotation to PDFDocument, Page, RectangleShows how to create a TextAnnotation with a linked PopupAnnotation in a PDF using Aspose.Pdf and ...
add-signature-field-to-pdfAdd Signature Field to PDF with Matching AppearanceDocument, SignatureField, DefaultAppearanceShows how to insert a user signature form field into an existing PDF and configure its default ap...
add-signature-image-stamp-to-last-pageAdd Signature Image Stamp to Last PDF PageDocument, Page, ImageStampShows how to load a PDF with Aspose.Pdf, create an ImageStamp from a signature image, position it...
add-styled-table-alternating-row-colorsAdd Styled Table with Alternating Row Colors to PDFDocument, Page, TableDemonstrates creating a table with borders, header styling, and alternating row background colors...
add-visible-digital-signature-and-lock-pdfAdd Visible Digital Signature Field and Lock PDFDocument, SignatureField, PKCS1The example loads an existing PDF, creates a visible signature field on the first page, signs it ...
add-watermark-layer-merge-layersAdd Watermark Layer and Merge Layers in PDFDocument, Layer, ImageStampDemonstrates how to create a watermark as an optional content group (layer), add it to each page ...
...and 90 more files

Category Statistics

  • Total examples: 120

Category-Specific Tips

Key API Surface

  • Aspose.Pdf.ArtifactCollection
  • Aspose.Pdf.ArtifactCollection.Add
  • Aspose.Pdf.ArtifactCollection.CopyTo
  • Aspose.Pdf.ArtifactCollection.Count
  • Aspose.Pdf.ArtifactCollection.Delete
  • Aspose.Pdf.ArtifactCollection.FindByValue
  • Aspose.Pdf.ArtifactCollection.GetEnumerator
  • Aspose.Pdf.ArtifactCollection.IsReadOnly
  • Aspose.Pdf.ArtifactCollection.IsSynchronized
  • Aspose.Pdf.ArtifactCollection.Item
  • Aspose.Pdf.ArtifactCollection.SyncRoot
  • Aspose.Pdf.ArtifactCollection.Update
  • Aspose.Pdf.AutoTaggingSettings
  • Aspose.Pdf.AutoTaggingSettings.Default
  • Aspose.Pdf.AutoTaggingSettings.EnableAutoTagging

Rules

  • Create MarkdownSaveOptions with parameterless constructor: new MarkdownSaveOptions().
  • To convert PDF to Markdown: create MarkdownSaveOptions, configure options, then call document.Save(outputPath, options).
  • Configure MarkdownSaveOptions by setting properties: ExtractVectorGraphics, AreaToExtract, SubscriptAndSuperscriptConversion, ResourcesDirectoryName, UseImageHtmlTag.
  • Create Matrix3D with parameterless constructor: new Matrix3D().
  • Create Matrix3D with: new Matrix3D(double[] matrix3DArray).

Warnings

  • Ensure the output file extension matches the format when using MarkdownSaveOptions.
  • Ensure the output file extension matches the format when using SaveOptions.

General Tips

  • See parent AGENTS.md for:
    • Boundaries -- Always / Ask First / Never rules for all examples
    • Common Mistakes -- verified anti-patterns that cause build failures
    • Domain Knowledge -- cross-cutting API-specific gotchas
    • Testing Guide -- build and run verification steps
  • Review code examples in this folder for document patterns
<!-- AUTOGENERATED:START -->

Updated: 2026-08-20 | Run: 20260820_001147_12d7b3

<!-- AUTOGENERATED:END -->

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.