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

agentic-net-examples / working-with-tables

AGENTS.md2 starsChanged 4 months agoMITView on GitHub

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

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:

    Create an {image} object, assign its File property to a {string_literal} path, and embed it in a table cell by invoking …

    line 115
  2. Distinctive:

    Add a {table} to a {page} via page.Paragraphs.Add({table}), configure its DefaultCellBorder with new BorderInfo(BorderSide.All, {float}) …

    line 116
  3. Distinctive:

    Create a Table, set column widths via a space‑separated string and enable auto‑fit to window: {table} = new Table().

    line 118

≈ “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-tables

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

Scope

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

Required Namespaces

  • using Aspose.Pdf; (96/96 files) ← category-specific
  • using Aspose.Pdf.Text; (70/96 files) ← category-specific
  • using Aspose.Pdf.Drawing; (14/96 files)
  • using Aspose.Pdf.LogicalStructure; (4/96 files)
  • using Aspose.Pdf.Tagged; (4/96 files)
  • using Aspose.Pdf.Forms; (2/96 files)
  • using Aspose.Pdf.Annotations; (1/96 files)
  • using Aspose.Pdf.Devices; (1/96 files)
  • using System; (96/96 files)
  • using System.IO; (72/96 files)
  • using System.Data; (13/96 files)
  • using System.Collections.Generic; (8/96 files)
  • using System.Linq; (8/96 files)
  • using System.Xml.Linq; (2/96 files)
  • using System.Globalization; (1/96 files)
  • using System.Text; (1/96 files)
  • using System.Text.Json; (1/96 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-auto-numbered-column-to-pdf-tableAdd Auto‑Numbered Column to PDF TableDocument, Page, TableShows how to create a PDF table with Aspose.Pdf and fill the first column with sequential numbers...
add-centered-paragraph-to-table-cellAdd Centered Paragraph to Table CellDocument, Page, TableDemonstrates how to create a PDF table with Aspose.Pdf and insert a paragraph into a cell with ho...
add-checkbox-form-field-in-table-cellAdd Checkbox Form Field Inside Table CellDocument, Page, TableShows how to create a PDF with a table and place a checkbox form field inside one of the table's ...
add-footnote-references-to-table-cellsAdd Footnote References to Table Cells in PDFDocument, Page, TableShows how to insert superscript footnote markers inside table cells, attach Aspose.Pdf footnote n...
add-list-items-in-table-cellAdd List Items Inside a Table CellDocument, Page, TableShows how to create a bullet list within a PDF table cell by adding TextFragment paragraphs with ...
add-multiline-text-to-table-cellAdd Multiline Text to Table Cell in PDFDocument, Page, TableDemonstrates how to insert multiline text into a PDF table cell by adding separate TextFragment o...
add-radio-button-group-in-table-cellAdd Radio Button Group Inside a Table CellDocument, Page, TableDemonstrates how to place a group of radio buttons inside a table cell by creating a RadioButtonF...
add-solid-border-to-pdf-tableAdd Solid Border to PDF TableDocument, Table, BorderInfoDemonstrates how to load an existing PDF, create a table, apply a solid black border to the entir...
add-table-footer-to-pdfAdd Table Footer Row Repeated on Each PDF PageDocument, Table, ITaggedContentDemonstrates how to add a visual table with a footer row that repeats at the bottom of each page ...
add-table-to-specific-pdf-pageAdd Table to Specific PDF PageDocument, Page, TableShows how to insert a formatted table onto a chosen page of a PDF document using Aspose.Pdf, incl...
add-table-with-background-colorAdd Table with Background Color to PDFDocument, Page, TableDemonstrates creating a PDF, inserting a table, and applying a solid background color while notin...
add-table-with-semi-transparent-backgroundAdd Table with Semi-Transparent Background to PDFDocument, Page, TableDemonstrates how to create a PDF, add a table, and set the table's background color with opacity ...
add-text-fragment-to-table-cellAdd TextFragment with Font and Size to a PDF Table CellDocument, Table, RowDemonstrates how to insert text with a specific font and size into a table cell by creating a Tex...
adjust-table-column-widths-proportionallyAdjust Table Column Widths Proportionally in PDFDocument, Page, TableShows how to compute the total width of a table's columns, convert each width to a percentage of ...
apply-different-autofit-behaviors-to-tablesApply Different AutoFit Behaviors to Tables in a PDFDocument, Page, TableDemonstrates how to add multiple tables to a PDF and set distinct ColumnAdjustment (AutoFitToCont...
apply-double-border-to-pdf-tableApply Double Border to PDF TableDocument, Page, TableCreates a PDF with a 3x3 table and sets a double‑border effect by configuring BorderInfo with wid...
auto-fit-table-columns-to-contentAuto‑Fit Table Columns to Content in PDFDocument, Page, TableLoads an existing PDF, creates a table, sets ColumnAdjustment to AutoFitToContent so columns resi...
auto-fit-table-row-heightAuto‑Fit Table Row Height in PDFDocument, Page, TableDemonstrates how to let a table row automatically adjust its height to fit wrapped cell content b...
batch-add-table-with-logo-to-pdfsBatch Add Table with Company Logo to PDFsDocument, Table, ImageDemonstrates how to iterate through a folder of PDF files, insert a two‑column table containing a...
batch-replace-tables-in-multiple-pdfsBatch Replace Tables in Multiple PDFsDocument, TableAbsorber, VisitDemonstrates how to iterate over PDF files, locate each table with TableAbsorber, create a replac...
calculate-remaining-page-space-add-tableCalculate Remaining Page Space and Add Table to PDFDocument, Page, CalculateContentBBoxDemonstrates how to compute the usable vertical space on a PDF page by subtracting margins and ex...
center-table-horizontallyCenter Table Horizontally in PDFDocument, Page, TableShows how to create a table, set its HorizontalAlignment to Center, and add it to a PDF page usin...
check-table-break-across-pagesCheck Table Break Across PagesDocument, Page, TableCreates a PDF with a simple two‑column table, adds it to a page, and reads the Table.IsBroken pro...
conditional-formatting-table-cellsConditional Formatting of Table Cells in PDFDocument, Page, TableDemonstrates how to create a PDF table with Aspose.Pdf, add data rows, and apply background color...
count-tables-in-pdfCount Tables in PDF using TableAbsorberDocument, TableAbsorber, VisitShows how to use Aspose.Pdf's TableAbsorber to locate and count tables in a PDF document.
create-fixed-width-table-pdfCreate Fixed-Width Table in PDFDocument, Page, TableShows how to set a table's total width to 500 points, add content, and save it as a PDF using Asp...
create-pdf-report-multiple-tablesCreate PDF Report with Multiple TablesDocument, Page, TextFragmentDemonstrates building a PDF document that contains several tables, each imported from a DataTable...
create-pdf-table-alternating-row-colorsCreate PDF Table with Alternating Row ColorsDocument, Page, TableShows how to generate a PDF table using Aspose.Pdf and apply alternating background colors to eac...
create-pdf-table-dynamic-row-countCreate PDF Table with Dynamic Row CountDocument, Page, TableDemonstrates building a DataTable at runtime, importing it into an Aspose.Pdf.Table, and saving t...
create-pdf-table-from-datatableCreate PDF Table from a DataTable with Aspose.PdfDocument, Page, TableDemonstrates how to fill an in‑memory DataTable, import it into an Aspose.Pdf Table, and save the...
...and 66 more files

Category Statistics

  • Total examples: 96

Category-Specific Tips

Key API Surface

  • Aspose.Pdf.BorderCornerStyle
  • Aspose.Pdf.BorderInfo
  • Aspose.Pdf.BorderSide
  • Aspose.Pdf.Cell
  • Aspose.Pdf.Color
  • Aspose.Pdf.ColumnAdjustment
  • Aspose.Pdf.Document
  • Aspose.Pdf.GraphInfo
  • Aspose.Pdf.HorizontalAlignment
  • Aspose.Pdf.Image
  • Aspose.Pdf.MarginInfo
  • Aspose.Pdf.Page
  • Aspose.Pdf.Row
  • Aspose.Pdf.Table
  • Aspose.Pdf.Table.GetWidth

Rules

  • Create an {image} object, assign its File property to a {string_literal} path, and embed it in a table cell by invoking cell.Paragraphs.Add({image}).
  • Add a {table} to a {page} via page.Paragraphs.Add({table}), configure its DefaultCellBorder with new BorderInfo(BorderSide.All, {float}) and set ColumnWidths using a space‑separated {string_literal}; then populate rows with table.Rows.Add() and cells with row.Cells.Add(...), optionally adjusting cell properties such as VerticalAlignment.
  • Instantiate a PDF document and add a page: {doc} = new Document(); {page} = {doc}.Pages.Add();
  • Create a Table, set column widths via a space‑separated string and enable auto‑fit to window: {table} = new Table(); {table}.ColumnWidths = "{string_literal}"; {table}.ColumnAdjustment = ColumnAdjustment.AutoFitToWindow;
  • Define default cell border and overall table border using BorderInfo with BorderSide.All and a thickness: {table}.DefaultCellBorder = new BorderInfo(BorderSide.All, {float}); {table}.Border = new BorderInfo(BorderSide.All, {float});

Warnings

  • ColumnWidths expects a space‑separated string of numeric values; ensure the format matches the table layout requirements.
  • ColumnAdjustment.AutoFitToWindow only takes effect when ColumnWidths are explicitly set; otherwise the table may not resize as expected.
  • GetWidth may return a meaningful value only after the table has been laid out (e.g., added to a page or after layout processing). In this isolated example the table is not added to the page, which could lead to default or zero width in some scenarios.
  • TableAbsorber and AbsorbedTable reside in the Aspose.Pdf.Text namespace; ensure the appropriate using directive is present.
  • TableAbsorber.TableList may be empty; accessing index 0 without checking can cause an exception.

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