agentleFS
aspose-pdfaspose-pdf/agentic-net-examples/working-with-graphs/AGENTS.md

agentic-net-examples / working-with-graphs

AGENTS.md2 starsChanged 4 months agoMITView on GitHub

C# examples for working-with-graphs using Aspose.PDF for .NET

The file

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

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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:

    Create a {doc} (Aspose.Pdf.Document), add a {page} (Aspose.Pdf.Page) via doc.Pages.Add(), instantiate a Graph (Aspose.Pdf.Drawing.Graph) …

    line 109

≈ “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 - working-with-graphs

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

Scope

  • This folder contains examples for working-with-graphs.
  • Files are standalone .cs examples stored directly in this folder.

Required Namespaces

  • using Aspose.Pdf; (72/72 files) ← category-specific
  • using Aspose.Pdf.Drawing; (69/72 files) ← category-specific
  • using Aspose.Pdf.Text; (7/72 files)
  • using Aspose.Pdf.Annotations; (1/72 files)
  • using Aspose.Pdf.Operators; (1/72 files)
  • using System; (72/72 files)
  • using System.IO; (30/72 files)
  • using System.Collections.Generic; (6/72 files)
  • using NUnit.Framework; (1/72 files)
  • using System.Text.Json; (1/72 files)
  • using System.Threading.Tasks; (1/72 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-background-image-and-graph-to-pdfAdd Background Image to PDF and Draw Graph Shapes on TopDocument, Page, ArtifactDemonstrates how to place a background image on a PDF page using an Artifact and then draw a Grap...
add-centered-graph-to-pdf-pageAdd Centered Graph to PDF PageDocument, Page, GraphShows how to create a Graph, center it horizontally and vertically on a PDF page, add it to the p...
add-dashed-rectangle-to-graphAdd Dashed Rectangle to Graph in PDFDocument, Page, GraphCreates a PDF document, adds a Graph container, draws a rectangle with a 2‑point black dashed bor...
add-ellipse-to-pdf-pageAdd Ellipse to PDF Page with Specified Radii and Stroke Colo...Document, Page, GraphDemonstrates how to open an existing PDF, create a Graph container, draw an ellipse with given ho...
add-filled-arc-to-pdf-graphAdd Filled Arc to PDF GraphDocument, Page, GraphDemonstrates how to create a PDF document, add a graph, and draw a filled arc with a custom color...
add-filled-arc-with-radial-gradientAdd Filled Arc with Radial Gradient to PDFDocument, Page, GraphCreates a PDF document, adds a graph containing an arc shape, and demonstrates how to apply a rad...
add-filled-circle-to-pdf-graphAdd Filled Circle to PDF Using Aspose.Pdf GraphDocument, Page, GraphDemonstrates how to create a PDF document, add a Graph container, draw a filled circle with a bor...
add-filled-curve-with-opacity-and-borderAdd Filled Curve with Opacity and Border to PDFDocument, Page, GraphDemonstrates how to draw a filled Bézier curve in a PDF using Aspose.Pdf, setting fill opacity an...
add-filled-rectangle-with-dashed-borderAdd Filled Rectangle with Dashed Border to PDF GraphDocument, Page, GraphDemonstrates how to draw a filled rectangle with a custom dashed border inside a Graph container ...
add-full-size-graph-to-pdf-pageAdd Full-Size Graph to PDF PageDocument, Page, GraphShows how to create a Graph object that matches the page dimensions of a PDF, add a rectangle sha...
add-gradient-ellipse-graphs-to-pdfsAdd Gradient Ellipse Graphs to PDFs in ParallelDocument, Page, GraphDemonstrates processing multiple PDF files concurrently and adding a graph with gradient‑filled e...
add-graph-rectangle-watermark-to-pdfAdd Graph Rectangle Watermark to PDF PagesDocument, Page, GraphThe example loads each PDF from an input folder, creates a Graph that matches the page size, adds...
add-graph-to-pdfAdd Graph to PDF DocumentDocument, Page, GraphShows how to load a PDF, create a Graph with shapes such as a rectangle and line, place it on a p...
add-graph-with-shapes-to-pdfAdd Graph with Shapes to a PDF PageDocument, Page, GraphLoads an existing PDF, adds a new page, creates a Graph container, draws a rectangle, ellipse, an...
add-multi-colored-line-segments-to-pdf-graphCreate a Multi‑Color Line Graph in PDFDocument, Page, GraphDemonstrates how to build a PDF document, add a Graph container, and draw multiple line segments ...
add-non-overlapping-rectangles-to-pdf-graphAdd Non-Overlapping Rectangles to a PDF GraphDocument, Page, GraphDemonstrates placing multiple rectangles of varying sizes on a PDF graph while preventing overlap...
add-rectangle-solid-red-fill-to-pdf-graphAdd Rectangle with Solid Red Fill to PDF GraphDocument, Page, GraphShows how to create a PDF, add a Graph container, define a rectangle using absolute coordinates, ...
add-rectangle-with-shadow-to-pdfAdd Rectangle with Shadow to PDFDocument, Page, GraphShows how to draw a rectangle with a semi‑transparent offset shadow in a PDF using Aspose.Pdf's G...
add-regular-hexagon-to-pdf-graphAdd Regular Hexagon to PDF GraphDocument, Page, GraphDemonstrates how to draw a regular six‑sided polygon (hexagon) on a PDF page using Aspose.Pdf's G...
add-rounded-rectangle-with-fill-to-pdf-graphAdd Rounded Rectangle with Fill to PDF GraphDocument, Page, GraphCreates a PDF document, adds a Graph container, and draws a rounded rectangle with a solid fill a...
add-rounded-rectangle-with-fillAdd Rounded Rectangle with Fill to PDFDocument, Page, GraphShows how to draw a rectangle with rounded corners, set a corner radius, and apply a solid fill u...
add-semi-transparent-rectangle-using-transparency-...Add Semi-Transparent Rectangle via Transparency LayerDocument, Page, GraphThe example opens an existing PDF, creates a Graph as a transparency layer, draws a semi‑transpar...
add-semi-transparent-rectangleAdd Semi-Transparent Rectangle Using Alpha ChannelDocument, Page, GraphCreates a PDF containing a rectangle filled with a semi‑transparent color to demonstrate alpha‑ch...
add-shadow-effect-to-filled-rectangleAdd Shadow Effect to a Filled Rectangle in PDFDocument, Page, GraphShows how to draw a filled rectangle with a simulated shadow by adding an offset semi‑transparent...
add-shapes-with-bounds-checkingAdd Shapes to PDF with Bounds CheckingDocument, Page, GraphDemonstrates loading a PDF, creating a Graph that spans the page, enabling bounds‑checking, addin...
add-text-inside-graphAdd Text Inside a Graph with Custom Font and PositionDocument, Page, GraphDemonstrates how to insert a Graph into a PDF page and place a formatted TextFragment inside it a...
add-unfilled-arc-with-custom-strokeAdd Unfilled Arc with Custom Stroke to PDFDocument, Page, GraphDemonstrates creating a PDF, adding a Graph container, drawing an unfilled arc, and customizing i...
align-graph-to-left-margin-pdfAlign Graph to Left Margin in PDFDocument, Page, GraphDemonstrates creating a Graph, positioning it with a left offset and top margin, adding a shape, ...
batch-insert-company-logo-graph-into-pdfsBatch Insert Company Logo Graph into PDFsDocument, Page, GraphShows how to process all PDF files in a folder, load each with Aspose.Pdf, add a predefined Graph...
build-reusable-graph-for-pdf-pagesCreate Reusable Graph with Shapes for PDF PagesDocument, Page, GraphDemonstrates how to build a predefined Graph containing a rectangle, ellipse, and line, and add i...
...and 42 more files

Category Statistics

  • Total examples: 72

Category-Specific Tips

Key API Surface

  • Aspose.Pdf.BorderInfo
  • Aspose.Pdf.BorderSide
  • Aspose.Pdf.Color
  • Aspose.Pdf.Document
  • Aspose.Pdf.Drawing.Ellipse
  • Aspose.Pdf.Drawing.Ellipse.Bottom
  • Aspose.Pdf.Drawing.Ellipse.CheckBounds
  • Aspose.Pdf.Drawing.Ellipse.Height
  • Aspose.Pdf.Drawing.Ellipse.Left
  • Aspose.Pdf.Drawing.Ellipse.Width
  • Aspose.Pdf.Drawing.GradientAxialShading
  • Aspose.Pdf.Drawing.GradientRadialShading
  • Aspose.Pdf.Drawing.GradientRadialShading.End
  • Aspose.Pdf.Drawing.GradientRadialShading.EndColor
  • Aspose.Pdf.Drawing.GradientRadialShading.EndingRadius

Rules

  • Create a {doc} (Aspose.Pdf.Document), add a {page} (Aspose.Pdf.Page) via doc.Pages.Add(), instantiate a Graph (Aspose.Pdf.Drawing.Graph) with width and height, and add it to page.Paragraphs.
  • Instantiate a Line (Aspose.Pdf.Drawing.Line) with a float[] of coordinates, optionally set line.GraphInfo.DashArray = int[] and line.GraphInfo.DashPhase = int to define dash style, then add the line to graph.Shapes.
  • Save the {doc} to a file path ({output_pdf}) using doc.Save().
  • Create a {graph} (Aspose.Pdf.Drawing.Graph) with dimensions {float} width and {float} height, set IsChangePosition={bool}, position it using Left={float} and Top={float}, add a Rectangle shape (Aspose.Pdf.Drawing.Rectangle) at (0,0) with the same dimensions, set its fill and border color to {color}, assign Graph.ZIndex={int}, then add the Graph to {page}.Paragraphs.
  • Set {page}.PageInfo.Margin.Left={float} and .Top={float} to zero (or desired offset) before placing Graph objects to ensure absolute positioning aligns with page coordinates.

Warnings

  • GraphInfo is accessed through the Line instance (line.GraphInfo); ensure the line object supports this property.
  • DashArray expects an int[] where the pattern values represent dash and gap lengths; incorrect values may produce unexpected rendering.
  • GraphInfo is accessed via the Rectangle.GraphInfo property; the exact type name may differ in newer library versions.
  • Rectangle constructor uses integer parameters for coordinates and size; ensure correct units.
  • GraphInfo may be null until the shape is added to a Graph; setting FillColor before adding is safe in this pattern.

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 working-with-graphs 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.