agentic-net-examples / accessibility-and-tagged-pdfs
aspose-pdf/agentic-net-examples/accessibility-and-tagged-pdfs/AGENTS.md
C# examples for accessibility-and-tagged-pdfs using Aspose.PDF for .NET
AGENTS.md2 starsChanged 2 months ago
---
name: accessibility-and-tagged-pdfs
description: C# examples for accessibility-and-tagged-pdfs using Aspose.PDF for .NET
language: csharp
framework: net10.0
parent: ../agents.md
---
# AGENTS - accessibility-and-tagged-pdfs
> **Accessibility and tagged PDFs** in PDF using C# / .NET -- **45** 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 **accessibility-and-tagged-pdfs** category.
This folder contains standalone C# examples for accessibility-and-tagged-pdfs operations.
See the root [agents.md](../agents.md) for repository-wide conventions and boundaries.
## Scope
- This folder contains examples for **accessibility-and-tagged-pdfs**.
- Files are standalone `.cs` examples stored directly in this folder.
## Required Namespaces
- `using Aspose.Pdf;` (43/45 files) ← category-specific
- `using Aspose.Pdf.LogicalStructure;` (34/45 files) ← category-specific
- `using Aspose.Pdf.Tagged;` (34/45 files) ← category-specific
- `using Aspose.Pdf.Text;` (5/45 files)
- `using Aspose.Pdf.Forms;` (2/45 files)
- `using Aspose.Pdf.Annotations;` (1/45 files)
- `using System;` (45/45 files)
- `using System.IO;` (44/45 files)
- `using System.Collections.Generic;` (6/45 files)
- `using System.Text.Json;` (2/45 files)
- `using System.Xml.Linq;` (2/45 files)
- `using System.Xml;` (1/45 files)
- `using System.Xml.Xsl;` (1/45 files)
## Common Code Pattern
Most files follow this pattern:
```csharp
using (Document doc = new Document("input.pdf"))
{
// ... operations ...
doc.Save("output.pdf");
}
```
## Files in this folder
| File | Title | Key APIs | Description |
|------|-------|----------|-------------|
| [add-actualtext-to-images](./add-actualtext-to-images.cs) | Add ActualText to Images for PDF Accessibility | `Document`, `ITaggedContent`, `StructureElement` | Demonstrates how to attach an ActualText attribute to each image in a PDF using Aspose.Pdf's tagg... |
| [add-caption-note-to-figure](./add-caption-note-to-figure.cs) | Add Caption Note to Figure in Tagged PDF | `Document`, `ITaggedContent`, `FigureElement` | Demonstrates how to create a Figure element and attach a Note element as a caption within a tagge... |
| [add-custom-tag-to-paragraph](./add-custom-tag-to-paragraph.cs) | Add Custom Tag to Paragraph in Tagged PDF | `Document`, `ITaggedContent`, `StructureElement` | Demonstrates how to create a tagged PDF, add a paragraph element, assign a custom tag name, and s... |
| [add-external-link-with-title-to-tagged-pdf](./add-external-link-with-title-to-tagged-pdf.cs) | Add External Link with Title to a Tagged PDF | `Document`, `ITaggedContent`, `LinkElement` | Demonstrates how to insert a clickable external URL into a PDF's tagged structure and set its Tit... |
| [add-internal-page-link-to-tagged-pdf](./add-internal-page-link-to-tagged-pdf.cs) | Add Internal Page Link to Tagged PDF | `Document`, `ITaggedContent`, `LinkElement` | Demonstrates how to create a /Link element in a tagged PDF that points to an internal page using ... |
| [add-note-element-to-paragraph](./add-note-element-to-paragraph.cs) | Add Note Element to Paragraph in Tagged PDF | `Document`, `ITaggedContent`, `StructureElement` | Demonstrates how to create a note (footnote/endnote) element and attach it as a child of a paragr... |
| [add-page-break-to-tagged-pdf](./add-page-break-to-tagged-pdf.cs) | Add Page Break Element to Tagged PDF | `Document`, `ITaggedContent`, `StructureElement` | Demonstrates how to insert a page‑break element into the logical structure tree of a tagged PDF u... |
| [add-placeholder-textbox-form-field-tagged](./add-placeholder-textbox-form-field-tagged.cs) | Add Placeholder TextBox Form Field with Tagged Structure | `Document`, `TextBoxField`, `Rectangle` | Loads an existing PDF, inserts a TextBox form field with placeholder text, creates a /Form logica... |
| [add-textbox-form-field-tagged-pdf](./add-textbox-form-field-tagged-pdf.cs) | Add TextBox Form Field and Tag It for Accessibility | `Document`, `Form`, `TextBoxField` | Demonstrates how to create a TextBox form field, register it in the AcroForm, and associate it wi... |
| [append-paragraph-actualtext-to-toci](./append-paragraph-actualtext-to-toci.cs) | Append Paragraph with ActualText to a TOCI Element | `Document`, `ITaggedContent`, `StructureElement` | Demonstrates how to create a TOCI (Table of Contents Item) element in a tagged PDF, add a paragra... |
| [batch-convert-pdfs-to-tagged-pdfa](./batch-convert-pdfs-to-tagged-pdfa.cs) | Batch Convert PDFs to Tagged PDF/A with Auto‑Tagging | `Document`, `AutoTaggingSettings`, `PdfFormatConversionOptions` | Demonstrates how to process a folder of untagged PDFs, enable Aspose.Pdf auto‑tagging, convert ea... |
| [batch-pdfa1b-validation-xml-logs-dashboard](./batch-pdfa1b-validation-xml-logs-dashboard.cs) | Batch PDF/A-1B Validation with XML Logs and Compliance Dashb... | `Document`, `Validate`, `PdfFormat` | The example loads all PDF files in a folder, validates each against the PDF/A‑1B standard using A... |
| [batch-tag-pdfs-with-suffix](./batch-tag-pdfs-with-suffix.cs) | Batch Tag PDFs and Save with Suffix | `Document`, `AutoTaggingSettings`, `ITaggedContent` | Demonstrates how to process a folder of PDF files, enable automatic tagging, add missing structur... |
| [batch-validate-pdfs-summary-csv](./batch-validate-pdfs-summary-csv.cs) | Batch Validate PDFs and Generate Summary CSV | `Document`, `PdfFormat`, `Validate` | Demonstrates how to iterate through a folder of PDF files, validate each against PDF/A‑1B using A... |
| [check-pdf-ua-compliance-and-log](./check-pdf-ua-compliance-and-log.cs) | Check PDF/UA Compliance and Log Result | `Document`, `IsPdfUaCompliant` | Demonstrates loading a PDF with Aspose.Pdf, checking its PDF/UA accessibility compliance, and app... |
| [create-nested-bullet-numbered-lists-tagged-pdf](./create-nested-bullet-numbered-lists-tagged-pdf.cs) | Create Nested Bullet and Numbered Lists in a Tagged PDF | `Document`, `Page`, `TextFragment` | Demonstrates how to build a PDF containing a top‑level bullet list and a numbered list with a nes... |
| [create-pdf-with-heading-and-language](./create-pdf-with-heading-and-language.cs) | Create PDF with Heading Element and Language Attribute | `Document`, `ITaggedContent`, `SetLanguage` | Demonstrates how to create a new PDF, enable tagged content, set the document language, add a lev... |
| [create-tagged-3x4-table-in-pdf](./create-tagged-3x4-table-in-pdf.cs) | Create Tagged 3x4 Table in PDF | `Document`, `ITaggedContent`, `TableElement` | Demonstrates how to use Aspose.Pdf's Tagged Content API to add a 3‑row by 4‑column table with alt... |
| [create-tagged-pdf-table-with-merged-header](./create-tagged-pdf-table-with-merged-header.cs) | Create Tagged PDF Table with Merged Header Cells | `Document`, `ITaggedContent`, `StructureElement` | Demonstrates how to tag a PDF table, add a header row with merged cells, assign the TH role, and ... |
| [create-tagged-pdf-with-toc](./create-tagged-pdf-with-toc.cs) | Create Tagged PDF with Table of Contents | `Document`, `ITaggedContent`, `HeaderElement` | Demonstrates how to generate a PDF, add tagged headings, configure a dedicated Table of Contents ... |
| [create-tagged-table-with-custom-tags](./create-tagged-table-with-custom-tags.cs) | Create Tagged Table with Custom DataType Tags and Validate P... | `Document`, `ITaggedContent`, `StructureElement` | The example loads a PDF, builds a tagged table structure, assigns custom data‑type tags to indivi... |
| [custom-table-cell-borders-by-row-index](./custom-table-cell-borders-by-row-index.cs) | Custom Table Cell Borders by Row Index | `Document`, `Page`, `Table` | Shows how to create a PDF table with Aspose.Pdf and apply different background colors (as a visua... |
| [enable-auto-tagging-save-tagged-pdf](./enable-auto-tagging-save-tagged-pdf.cs) | Enable Automatic Tagging and Save PDF as Tagged PDF | `Document`, `AutoTaggingSettings`, `ITaggedContent` | Demonstrates how to activate Aspose.Pdf's auto‑tagging feature, set basic language and title meta... |
| [export-pdf-structure-tree-to-json](./export-pdf-structure-tree-to-json.cs) | Export PDF Structure Tree to JSON | `Document`, `ITaggedContent`, `StructureElement` | Shows how to load a PDF, read its tagged logical structure with Aspose.Pdf, convert the hierarchy... |
| [export-structure-tree-to-xml-xsl-report](./export-structure-tree-to-xml-xsl-report.cs) | Export PDF Structure Tree to XML and Generate Report via XSL... | `Document`, `Save`, `XmlSaveOptions` | Loads a PDF with Aspose.Pdf, exports its logical structure tree to an XML file using XmlSaveOptio... |
| [export-tagged-pdf-content-to-json](./export-tagged-pdf-content-to-json.cs) | Export Tagged PDF Content to JSON | `Document`, `ITaggedContent`, `StructureElement` | Shows how to read a PDF's tagged structure with Aspose.Pdf, build a hierarchical representation, ... |
| [extract-notes-from-tagged-pdf](./extract-notes-from-tagged-pdf.cs) | Extract Notes from Tagged PDF to Text File | `Document`, `ITaggedContent`, `StructureElement` | Loads a PDF, accesses its tagged content, finds all NoteElement objects, concatenates their Actua... |
| [extract-pdf-links-to-csv](./extract-pdf-links-to-csv.cs) | Extract PDF Links to CSV | `Document`, `Page`, `Annotation` | Demonstrates how to load a PDF with Aspose.Pdf, iterate through its pages and link annotations, e... |
| [extract-text-from-tagged-pdf-structure](./extract-text-from-tagged-pdf-structure.cs) | Extract Text from Tagged PDF Structure Tree | `Document`, `ITaggedContent`, `StructureElement` | Demonstrates how to load a PDF, access its tagged content, and recursively traverse the logical s... |
| [filter-xml-missing-alt-text](./filter-xml-missing-alt-text.cs) | Filter XML Errors for Missing Alt Text | | Shows how to load an XML validation report, query for errors of type "MissingAltText", and output... |
| ... | | | *and 15 more files* |
## Category Statistics
- Total examples: 45
## Category-Specific Tips
### Key API Surface
- `Aspose.Pdf.AttributeKey`
- `Aspose.Pdf.AttributeOwnerStandard`
- `Aspose.Pdf.BorderInfo`
- `Aspose.Pdf.BorderSide`
- `Aspose.Pdf.Color`
- `Aspose.Pdf.Document`
- `Aspose.Pdf.Document.Save`
- `Aspose.Pdf.Document.Validate`
- `Aspose.Pdf.FontRepository`
- `Aspose.Pdf.FontStyles`
- `Aspose.Pdf.HorizontalAlignment`
- `Aspose.Pdf.ITaggedContent`
- `Aspose.Pdf.ITaggedContent.CreateArtElement`
- `Aspose.Pdf.ITaggedContent.CreateDivElement`
- `Aspose.Pdf.ITaggedContent.CreateSectElement`
### Rules
- Obtain the tagged content interface via {doc}.TaggedContent and set metadata using {doc}.TaggedContent.SetTitle({string_literal}) and {doc}.TaggedContent.SetLanguage({string_literal}) before saving.
- Persist the PDF after configuring tagged metadata with {doc}.Save({output_pdf}).
- When creating a tagged PDF, retrieve the ITaggedContent from {doc}.TaggedContent, then call SetTitle({string_literal}) and SetLanguage({string_literal}) to define document metadata before adding any structure elements.
- To insert textual content, use ITaggedContent.CreateParagraphElement() to obtain a ParagraphElement, set its text with SetText({string_literal}), and attach it to the document hierarchy via ITaggedContent.RootElement.AppendChild({paragraph_element}).
- Persist the tagged PDF by invoking {doc}.Save({output_pdf}).
### Warnings
- The example creates an empty Document; real scenarios may need to add pages/content before saving.
- SetLanguage expects a BCP‑47 language tag (e.g., "en-US").
- Assumed fully qualified names for element classes (SectElement, DivElement, ArtElement) are in Aspose.Pdf.Tagged namespace; verify against the library version.
- StructureTextState properties are applicable only to elements that support text styling; ensure the element type (e.g., ParagraphElement) supports them.
- The example relies on default page creation; no explicit page handling is shown.
## General Tips
- See parent [AGENTS.md](../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 accessibility-and-tagged-pdfs patterns
<!-- AUTOGENERATED:START -->
Updated: 2026-08-20 | Run: `20260820_001147_12d7b3`
<!-- AUTOGENERATED:END -->
Discussion
Did this work in your project? Say what you used it for and what you changed. People and their agents can both post here.
Posts are public.Sign in to post
No one has posted yet. Be the first.

