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
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository36 other files it gives its agents.
- accessibility-and-tagged-pdfsAGENTS.md
- aspose-pdf-examplesAGENTS.md
- basic-operationsAGENTS.md
- compare-pdfAGENTS.md
- conversionAGENTS.md
- documentAGENTS.md
- facades-acroformsAGENTS.md
- facades-annotationsAGENTS.md
- facades-bookmarksAGENTS.md
- facades-convert-documentsAGENTS.md
- facades-documentsAGENTS.md
- facades-edit-documentAGENTS.md
- facades-extract-images-and-textAGENTS.md
- facades-fill-formsAGENTS.md
- facades-formsAGENTS.md
- facades-metadataAGENTS.md
- facades-pagesAGENTS.md
- facades-secure-documentsAGENTS.md
- facades-sign-documentsAGENTS.md
- facades-stampsAGENTS.md
- facades-texts-and-imagesAGENTS.md
- facades-xmp-metadataAGENTS.md
- graphs-zugferd-operatorsAGENTS.md
- pagesAGENTS.md
- parse-pdfAGENTS.md
- securing-and-signing-pdfAGENTS.md
- stampingAGENTS.md
- uncategorizedAGENTS.md
- working-with-annotationsAGENTS.md
- working-with-attachmentsAGENTS.md
- working-with-formsAGENTS.md
- working-with-imagesAGENTS.md
- working-with-tablesAGENTS.md
- working-with-textAGENTS.md
- working-with-xmlAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
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
- Distinctive: line 109
Create a {doc} (Aspose.Pdf.Document), add a {page} (Aspose.Pdf.Page) via doc.Pages.Add(), instantiate a Graph (Aspose.Pdf.Drawing.Graph) …
≈ “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.
Files
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
.csfile 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
.csexamples stored directly in this folder.
Required Namespaces
using Aspose.Pdf;(72/72 files) ← category-specificusing Aspose.Pdf.Drawing;(69/72 files) ← category-specificusing 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
| File | Title | Key APIs | Description |
| add-background-image-and-graph-to-pdf | Add Background Image to PDF and Draw Graph Shapes on Top | Document, Page, Artifact | Demonstrates how to place a background image on a PDF page using an Artifact and then draw a Grap... |
| add-centered-graph-to-pdf-page | Add Centered Graph to PDF Page | Document, Page, Graph | Shows how to create a Graph, center it horizontally and vertically on a PDF page, add it to the p... |
| add-dashed-rectangle-to-graph | Add Dashed Rectangle to Graph in PDF | Document, Page, Graph | Creates a PDF document, adds a Graph container, draws a rectangle with a 2‑point black dashed bor... |
| add-ellipse-to-pdf-page | Add Ellipse to PDF Page with Specified Radii and Stroke Colo... | Document, Page, Graph | Demonstrates how to open an existing PDF, create a Graph container, draw an ellipse with given ho... |
| add-filled-arc-to-pdf-graph | Add Filled Arc to PDF Graph | Document, Page, Graph | Demonstrates how to create a PDF document, add a graph, and draw a filled arc with a custom color... |
| add-filled-arc-with-radial-gradient | Add Filled Arc with Radial Gradient to PDF | Document, Page, Graph | Creates a PDF document, adds a graph containing an arc shape, and demonstrates how to apply a rad... |
| add-filled-circle-to-pdf-graph | Add Filled Circle to PDF Using Aspose.Pdf Graph | Document, Page, Graph | Demonstrates how to create a PDF document, add a Graph container, draw a filled circle with a bor... |
| add-filled-curve-with-opacity-and-border | Add Filled Curve with Opacity and Border to PDF | Document, Page, Graph | Demonstrates how to draw a filled Bézier curve in a PDF using Aspose.Pdf, setting fill opacity an... |
| add-filled-rectangle-with-dashed-border | Add Filled Rectangle with Dashed Border to PDF Graph | Document, Page, Graph | Demonstrates how to draw a filled rectangle with a custom dashed border inside a Graph container ... |
| add-full-size-graph-to-pdf-page | Add Full-Size Graph to PDF Page | Document, Page, Graph | Shows how to create a Graph object that matches the page dimensions of a PDF, add a rectangle sha... |
| add-gradient-ellipse-graphs-to-pdfs | Add Gradient Ellipse Graphs to PDFs in Parallel | Document, Page, Graph | Demonstrates processing multiple PDF files concurrently and adding a graph with gradient‑filled e... |
| add-graph-rectangle-watermark-to-pdf | Add Graph Rectangle Watermark to PDF Pages | Document, Page, Graph | The example loads each PDF from an input folder, creates a Graph that matches the page size, adds... |
| add-graph-to-pdf | Add Graph to PDF Document | Document, Page, Graph | Shows 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-pdf | Add Graph with Shapes to a PDF Page | Document, Page, Graph | Loads an existing PDF, adds a new page, creates a Graph container, draws a rectangle, ellipse, an... |
| add-multi-colored-line-segments-to-pdf-graph | Create a Multi‑Color Line Graph in PDF | Document, Page, Graph | Demonstrates how to build a PDF document, add a Graph container, and draw multiple line segments ... |
| add-non-overlapping-rectangles-to-pdf-graph | Add Non-Overlapping Rectangles to a PDF Graph | Document, Page, Graph | Demonstrates placing multiple rectangles of varying sizes on a PDF graph while preventing overlap... |
| add-rectangle-solid-red-fill-to-pdf-graph | Add Rectangle with Solid Red Fill to PDF Graph | Document, Page, Graph | Shows how to create a PDF, add a Graph container, define a rectangle using absolute coordinates, ... |
| add-rectangle-with-shadow-to-pdf | Add Rectangle with Shadow to PDF | Document, Page, Graph | Shows how to draw a rectangle with a semi‑transparent offset shadow in a PDF using Aspose.Pdf's G... |
| add-regular-hexagon-to-pdf-graph | Add Regular Hexagon to PDF Graph | Document, Page, Graph | Demonstrates 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-graph | Add Rounded Rectangle with Fill to PDF Graph | Document, Page, Graph | Creates a PDF document, adds a Graph container, and draws a rounded rectangle with a solid fill a... |
| add-rounded-rectangle-with-fill | Add Rounded Rectangle with Fill to PDF | Document, Page, Graph | Shows 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 Layer | Document, Page, Graph | The example opens an existing PDF, creates a Graph as a transparency layer, draws a semi‑transpar... |
| add-semi-transparent-rectangle | Add Semi-Transparent Rectangle Using Alpha Channel | Document, Page, Graph | Creates a PDF containing a rectangle filled with a semi‑transparent color to demonstrate alpha‑ch... |
| add-shadow-effect-to-filled-rectangle | Add Shadow Effect to a Filled Rectangle in PDF | Document, Page, Graph | Shows how to draw a filled rectangle with a simulated shadow by adding an offset semi‑transparent... |
| add-shapes-with-bounds-checking | Add Shapes to PDF with Bounds Checking | Document, Page, Graph | Demonstrates loading a PDF, creating a Graph that spans the page, enabling bounds‑checking, addin... |
| add-text-inside-graph | Add Text Inside a Graph with Custom Font and Position | Document, Page, Graph | Demonstrates how to insert a Graph into a PDF page and place a formatted TextFragment inside it a... |
| add-unfilled-arc-with-custom-stroke | Add Unfilled Arc with Custom Stroke to PDF | Document, Page, Graph | Demonstrates creating a PDF, adding a Graph container, drawing an unfilled arc, and customizing i... |
| align-graph-to-left-margin-pdf | Align Graph to Left Margin in PDF | Document, Page, Graph | Demonstrates creating a Graph, positioning it with a left offset and top margin, adding a shape, ... |
| batch-insert-company-logo-graph-into-pdfs | Batch Insert Company Logo Graph into PDFs | Document, Page, Graph | Shows how to process all PDF files in a folder, load each with Aspose.Pdf, add a predefined Graph... |
| build-reusable-graph-for-pdf-pages | Create Reusable Graph with Shapes for PDF Pages | Document, Page, Graph | Demonstrates 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.BorderInfoAspose.Pdf.BorderSideAspose.Pdf.ColorAspose.Pdf.DocumentAspose.Pdf.Drawing.EllipseAspose.Pdf.Drawing.Ellipse.BottomAspose.Pdf.Drawing.Ellipse.CheckBoundsAspose.Pdf.Drawing.Ellipse.HeightAspose.Pdf.Drawing.Ellipse.LeftAspose.Pdf.Drawing.Ellipse.WidthAspose.Pdf.Drawing.GradientAxialShadingAspose.Pdf.Drawing.GradientRadialShadingAspose.Pdf.Drawing.GradientRadialShading.EndAspose.Pdf.Drawing.GradientRadialShading.EndColorAspose.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 -->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
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.

