# Creating Accessible PDF Documents

Use `RadPdfProcessing` of Telerik Document Processing to generate accessible PDF documents. This article shows how to export accessible output by using compliance settings, tagging strategies, and structure trees.

Feature availability and related documentation:

* Minimum version: Q3 2025
* Related feature: [Accessibility Support](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/features/accessibility-support/overview)

To export accessible output, the document must target **PDF/A-1a**, **PDF/A-2a**, **PDF/A-3a**, or **PDF/UA-1** compliance. To achieve this, configure `PdfFormatProvider.ExportSettings.ComplianceLevel` and `PdfFormatProvider.ExportSettings.TaggingStrategy` as described in [PdfComplianceLevel](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/concepts/comply-with-pdfa-standard#accessibility-compliance) and [Tagged PDF](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/tagged-pdf).

`RadFixedDocument` provides a constructor overload with an `autoTag` parameter. The `AutoTag` property is `false` by default. You can either build the `StructureTree` yourself or let the library tag elements automatically.

> note Refer to the [PdfProcessing Accessibility Demo](https://demos.telerik.com/document-processing/pdfprocessing/accessibility). It shows how to create accessible PDF documents programmatically and export files that match the selected compliance level.

> important In **.NET Standard/.NET (Target OS: None)** environments, fonts beyond the [14 standard ones](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/concepts/fonts#standard-fonts) require a [FontsProvider implementation](https://www.telerik.com/document-processing-libraries/documentation/knowledge-base/pdfprocessing-implement-fontsprovider) to be resolved correctly.

## Creating Accessible PDF Documents with an Existing Structure Tree

When you already have a `StructureTree`, export the document with [`TaggingStrategyType.UseExisting`](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/tagged-pdf#tagging-strategy) so the existing structure is preserved:

```C#

//Required for exporting images in .NET Standard
//Telerik.Documents.ImageUtils.ImagePropertiesResolver defaultImagePropertiesResolver = new Telerik.Documents.ImageUtils.ImagePropertiesResolver();
//Telerik.Documents.Extensibility.FixedExtensibilityManager.ImagePropertiesResolver = defaultImagePropertiesResolver;

RadFixedDocument fixedDocument = new RadFixedDocument(autoTag: false);
fixedDocument.DocumentInfo.Title = "Accessible Document Example";
fixedDocument.ViewerPreferences.ShouldDisplayDocumentTitle = true;

StructureElement documentStructureElement = fixedDocument.StructureTree.ChildElements.AddStructureElement(StructureTagType.Document);
StructureElement sectionStructureElement = documentStructureElement.ChildElements.AddStructureElement(StructureTagType.Section);
StructureElement paragraphStructureElement1 = sectionStructureElement.ChildElements.AddStructureElement("CustomParagraph", StructureTagType.Paragraph);
StructureElement paragraphStructureElement2 = sectionStructureElement.ChildElements.AddStructureElement(StructureTagType.Paragraph);
StructureElement figureStructureElement = sectionStructureElement.ChildElements.AddStructureElement(StructureTagType.Figure);

RadFixedPage fixedPage = fixedDocument.Pages.AddPage();

MarkedContent paragraphContainer1 = fixedPage.Content.AddMarkedContent();
TextFragment textFragment1 = paragraphContainer1.Content.AddTextFragment("Text fragment 1");
textFragment1.Font = FontsRepository.Courier;
textFragment1.Position.Translate(20, 20);

paragraphContainer1.StructureTag = paragraphStructureElement1;
paragraphStructureElement1.AlternateDescription = "Standard Paragraph in English";
paragraphStructureElement1.Language = "EN";
paragraphStructureElement1.ActualText = "Text fragment 1";

MarkedContent paragraphContainer2 = fixedPage.Content.AddMarkedContent();
TextFragment textFragment2 = paragraphContainer2.Content.AddTextFragment("Fragmento de texto 2");
textFragment2.Font = FontsRepository.Courier;
textFragment2.Position.Translate(20, 100);

paragraphContainer2.StructureTag = paragraphStructureElement2;
paragraphStructureElement2.Language = "ES";
paragraphStructureElement2.AlternateDescription = "Custom Paragraph in Spanish";
paragraphStructureElement2.ActualText = "Fragmento de texto 2";

MarkedContent imageContainer1 = fixedPage.Content.AddMarkedContent();
figureStructureElement.Language = "EN";
figureStructureElement.AlternateDescription = "Image of a Telerik Ninja";
figureStructureElement.ActualText = "Telerik Ninja logo";
var img = imageContainer1.Content.AddImage();
img.Position.Translate(100, 200);
img.ImageSource = new Telerik.Documents.Fixed.Model.Resources.ImageSource(
    File.OpenRead(@"ProgressNinjas.png"));
imageContainer1.StructureTag = figureStructureElement;
figureStructureElement.AlternateDescription = "Progress Ninja";

PdfFormatProvider provider = new PdfFormatProvider();
PdfExportSettings settings = new PdfExportSettings();
provider.ExportSettings = settings;

settings.TaggingStrategy = TaggingStrategyType.UseExisting;
settings.ComplianceLevel = PdfComplianceLevel.PdfUA1;
string outputFilePath = "AccessibleDocument.pdf";
File.Delete(outputFilePath);
using (Stream output = File.OpenWrite(outputFilePath))
{
    provider.Export(fixedDocument, output, TimeSpan.FromSeconds(10));
}

Process.Start(new ProcessStartInfo() { FileName = outputFilePath, UseShellExecute = true });

```

The following screenshots show the validation and structure views for the generated PDF.

> caption PDF Accessibility Checker validation

![Accessible PDF validation in PDF Accessibility Checker.](https://www.telerik.com/document-processing-libraries/documentation/assets/30d980949a30da69674daaae84680bb2/accessible-pdf-validity.png)

> caption Logical structure

![Logical structure of the generated PDF.](https://www.telerik.com/document-processing-libraries/documentation/assets/0a8d7c6880dc97693dfe9815fe1028ed/accessible-pdf-logical-structure.png)

> caption Logical structure properties

![Properties associated with the PDF logical structure.](https://www.telerik.com/document-processing-libraries/documentation/assets/e4a8e4c8daa1421af7aa936dc6bee9f5/accessible-pdf-logical-structure-properties.png)

## Creating Accessible PDF Documents with Auto-Tagging

The following example adds content to a PDF document and lets `RadPdfProcessing` build the `StructureTree` automatically by using `TaggingStrategyType.Build`:

```C#

//Required for exporting images in .NET Standard
//Telerik.Documents.ImageUtils.ImagePropertiesResolver defaultImagePropertiesResolver = new Telerik.Documents.ImageUtils.ImagePropertiesResolver();
//Telerik.Documents.Extensibility.FixedExtensibilityManager.ImagePropertiesResolver = defaultImagePropertiesResolver;

RadFixedDocument fixedDocument = new RadFixedDocument(autoTag: true);
fixedDocument.DocumentInfo.Title = "Accessible Document Example";
fixedDocument.ViewerPreferences.ShouldDisplayDocumentTitle = true;

RadFixedPage fixedPage = fixedDocument.Pages.AddPage();

MarkedContent paragraphContainer1 = fixedPage.Content.AddMarkedContent();
TextFragment textFragment1 = paragraphContainer1.Content.AddTextFragment("Text fragment 1");
textFragment1.Font = FontsRepository.Courier;
textFragment1.Position.Translate(20, 20);

MarkedContent paragraphContainer2 = fixedPage.Content.AddMarkedContent();
TextFragment textFragment2 = paragraphContainer2.Content.AddTextFragment("Fragmento de texto 2");
textFragment2.Font = FontsRepository.Courier;
textFragment2.Position.Translate(20, 100);

MarkedContent imageContainer1 = fixedPage.Content.AddMarkedContent();
var img = imageContainer1.Content.AddImage();
img.Position.Translate(100, 200);
img.ImageSource = new Telerik.Documents.Fixed.Model.Resources.ImageSource(
    File.OpenRead(@"ProgressNinjas.png"));

PdfFormatProvider provider = new PdfFormatProvider();
PdfExportSettings settings = new PdfExportSettings();
provider.ExportSettings = settings;

settings.TaggingStrategy = TaggingStrategyType.Build;
settings.ComplianceLevel = PdfComplianceLevel.PdfUA1;
string outputFilePath = "AccessibleDocumentAuto.pdf";
File.Delete(outputFilePath);
using (Stream output = File.OpenWrite(outputFilePath))
{
    provider.Export(fixedDocument, output, TimeSpan.FromSeconds(10));
}

Process.Start(new ProcessStartInfo() { FileName = outputFilePath, UseShellExecute = true });
```

## See Also

* [RadPdfProcessing](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/overview)
* [Tagged PDF](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/tagged-pdf)
* [Marked Content](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/marked-content)
* [StructureTree](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/model/structure-tree)
* [Export Settings](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfformatprovider/settings#export-settings)
* [PdfProcessing Accessibility Demo](https://demos.telerik.com/document-processing/pdfprocessing/accessibility)
