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

agentic-net-examples / pages

AGENTS.md2 starsChanged 4 months agoMITView on GitHub

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

2 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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    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:

    Delete a particular page by invoking {doc}.Pages.Delete({int}) where the integer is the 1‑based page number.

    line 105
  2. Distinctive:

    Read the total number of pages via {doc}.Pages.Count after the document is successfully loaded.

    line 108
  3. Distinctive:

    If {output_pdf} already exists it will be overwritten without warning.

    line 115

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “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 - pages

Pages in PDF using C# / .NET -- 100 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 pages category. This folder contains standalone C# examples for pages operations. See the root agents.md for repository-wide conventions and boundaries.

Scope

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

Required Namespaces

  • using Aspose.Pdf; (100/100 files) ← category-specific
  • using Aspose.Pdf.Text; (17/100 files)
  • using Aspose.Pdf.Facades; (3/100 files)
  • using Aspose.Pdf.Annotations; (2/100 files)
  • using Aspose.Pdf.Drawing; (2/100 files)
  • using System; (100/100 files)
  • using System.IO; (98/100 files)
  • using System.Collections.Generic; (5/100 files)
  • using System.Linq; (4/100 files)
  • using System.Text.Json; (1/100 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-bates-numbering-to-pdf-pagesAdd Bates Numbering to PDF PagesDocument, Pages, AddBatesNumberingShows how to insert Bates numbering stamps starting at 1000 with a dash separator on every page o...
add-bates-numbering-to-pdf-pages__v2Add Bates Numbering to PDF PagesDocument, Pages, AddBatesNumberingLoads a PDF document, applies year‑based Bates numbering (format "2026-####") to each page, and s...
add-bates-numbering-with-custom-prefix-suffixAdd Bates Numbering with Custom Prefix and Suffix to PDFDocument, PageCollection, AddBatesNumberingDemonstrates loading a PDF with Aspose.Pdf, applying Bates numbering that includes a custom prefi...
add-bates-numbering-with-prefixAdd Bates Numbering with Alphanumeric Prefix to PDFDocument, Pages, AddBatesNumberingShows how to load a PDF using Aspose.Pdf, apply Bates numbering with a custom alphanumeric prefix...
add-blank-front-matter-page-roman-labelAdd Blank Front‑Matter Page with Roman Numeral LabelDocument, Page, PageLabelDemonstrates how to insert a blank page at the beginning of an existing PDF and assign a custom p...
add-bold-uppercase-header-to-pdf-pagesAdd Bold Uppercase Header to PDF PagesDocument, Page, HeaderFooterShows how to insert a bold, uppercase header on every page of a PDF document using Aspose.Pdf.
add-chapter-page-numbers-to-pdfAdd Chapter Prefix Page Numbers to PDFDocument, PageNumberStamp, FindFontDemonstrates how to insert page numbers with a custom "Chapter" prefix on every page of a PDF usi...
add-curved-text-watermark-to-pdf-pagesAdd Curved Text Watermark to PDF PagesDocument, Page, WatermarkArtifactShows how to place a repeated watermark that follows a curved arc across each page of a PDF using...
add-custom-page-numbers-to-pdfAdd Custom Page Numbers to PDFDocument, PageNumberStamp, AddStampDemonstrates how to load a PDF with Aspose.Pdf, create a PageNumberStamp using the format "Page X...
add-diagonal-text-watermark-to-pdf-pagesAdd Diagonal Text Watermark to PDF PagesDocument, Page, TextStampShows how to load a PDF, iterate through its pages, and apply a semi‑transparent diagonal text wa...
add-generation-date-footer-to-pdf-pagesAdd Generation Date Footer to Each PDF PageDocument, Page, FooterArtifactDemonstrates how to add a text footer with the current generation date to every page of a PDF usi...
add-header-logo-image-to-pdf-pagesAdd Header Logo Image to PDF PagesDocument, ImageStamp, AddStampShows how to load a PDF, create an ImageStamp for a company logo, align it to the top‑left of eac...
add-header-to-first-pdf-pageAdd Header Text to First PDF Page Using MarginInfoDocument, HeaderFooter, MarginInfoDemonstrates how to add a text header to the first page of a PDF by configuring a HeaderFooter wi...
add-html-header-to-first-three-pdf-pagesAdd HTML Header with CSS to First Three PDF PagesDocument, Page, HtmlFragmentDemonstrates how to embed a styled HTML header into the first three pages of a PDF using Aspose.P...
add-image-footer-to-pdf-pagesAdd Image Footer with Opacity to PDF PagesDocument, Page, FooterArtifactDemonstrates how to add an image footer with 30% opacity to every page of a PDF using Aspose.Pdf.
add-image-footer-with-scaling-to-pdf-pagesAdd Image Footer with Scaling to PDF PagesDocument, Page, ImageShows how to insert a scaled footer image on every page of a PDF document using Aspose.Pdf.
add-image-watermark-with-opacity-to-pdf-pagesAdd Image Watermark with Opacity to PDF PagesDocument, ImageStamp, AddStampDemonstrates how to overlay a semi‑transparent image (logo) on every page of a PDF using Aspose.P...
add-lightgray-background-to-pdf-pagesAdd LightGray Background to PDF PagesDocument, Page, ColorShows how to load a PDF with Aspose.Pdf, iterate over each page, set a LightGray background color...
add-multiple-empty-pages-to-pdfAdd Multiple Empty Pages Sequentially to PDFDocument, Pages, PageCollectionDemonstrates how to add a series of empty pages to a PDF by iterating over a list of page counts,...
add-page-numbers-to-even-pdf-pagesAdd Page Numbers to Even PDF PagesDocument, PageNumberStamp, HorizontalAlignmentDemonstrates loading a PDF with Aspose.Pdf, iterating through its pages, and adding a page number...
add-page-numbers-to-odd-pdf-pagesAdd Page Numbers to Odd PDF PagesDocument, PageNumberStamp, PutDemonstrates loading a PDF with Aspose.Pdf, iterating through its pages, and applying a page numb...
add-page-numbers-to-pdfAdd Page Numbers to PDF PagesDocument, PageNumberStamp, AddStampShows how to insert a centered page number stamp starting at 1 on every page of a PDF using Aspos...
add-page-numbers-with-custom-embedded-fontAdd Page Numbers with Custom Embedded Font to PDFDocument, FindFont, FontDemonstrates how to insert page numbers on every PDF page using a TrueType font loaded from an ex...
add-repeating-image-watermark-to-pdf-pagesAdd Repeating Image Watermark to PDF PagesDocument, Page, ImageStampDemonstrates how to overlay a semi‑transparent image repeatedly in a grid pattern on every page o...
add-roman-numeral-page-numbersAdd Roman Numeral Page Numbers to Introductory PDF PagesDocument, PageNumberStamp, NumberingStyleDemonstrates how to insert page numbers in uppercase Roman numeral format on the first few pages ...
add-rotated-image-watermark-to-pdf-pagesAdd Rotated Image Watermark to PDF PagesDocument, Page, ImageStampDemonstrates how to overlay a 45‑degree rotated, half‑size image as a watermark on every page of ...
add-semi-transparent-text-watermarkAdd Semi-Transparent Text Watermark with Outline to PDF Page...Document, AddStamp, TextStampDemonstrates how to load a PDF, iterate through its pages, and apply a semi‑transparent text wate...
add-superscript-page-numbers-to-pdfAdd Superscript Page Numbers to PDF PagesDocument, Page, PageNumberStampShows how to insert page numbers with a superscript‑style appearance on every page of a PDF using...
add-year-text-watermark-to-pdfAdd Year-Based Text Watermark to PDFDocument, AddStamp, TextStampShows how to load a PDF, create a TextStamp that includes the current year, apply it to every pag...
adjust-pdf-bleedbox-for-printer-specsAdjust PDF BleedBox for Printer SpecificationsDocument, Page, RectangleShows how to read each page's BleedBox, expand it by a margin, and save the modified PDF using As...
...and 70 more files

Category Statistics

  • Total examples: 100

Category-Specific Tips

Key API Surface

  • Aspose.Pdf.BackgroundArtifact
  • Aspose.Pdf.ColorType
  • Aspose.Pdf.Document
  • Aspose.Pdf.Document.Pages
  • Aspose.Pdf.Document.Save
  • Aspose.Pdf.Page
  • Aspose.Pdf.Page.GetPageRect(bool)
  • Aspose.Pdf.PageCollection
  • Aspose.Pdf.PageCollection.Add
  • Aspose.Pdf.Rotation
  • Aspose.Pdf.Text.TextFragment

Rules

  • Load a PDF into a {doc} using new Document({input_pdf}).
  • Delete a particular page by invoking {doc}.Pages.Delete({int}) where the integer is the 1‑based page number.
  • Persist the changes by calling {doc}.Save({output_pdf}).
  • Instantiate a {doc} by calling new Document({input_pdf}) to load a PDF file.
  • Read the total number of pages via {doc}.Pages.Count after the document is successfully loaded.

Warnings

  • The Delete method expects a 1‑based page index and will throw if the index is out of range.
  • The helper method RunExamples.GetDataDir_AsposePdf_Pages() is external to this snippet and must provide a valid directory path.
  • The added page inherits the default page size of the document; specify size explicitly if a different layout is required.
  • The Add method copies all pages; selective page ranges require additional filtering.
  • If {output_pdf} already exists it will be overwritten without warning.

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 pages 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.