@TJTomJames
Thanks for being patient.
We would like to inform you that PDF/UA Compatibility has been added in Aspose.PDF for .NET 18.9 and now you can create PDF document which is compatible with PDF/UA standard (also known as “Section 508” or “WCAG standard”) and also check compatibility with this standard.
In latest version of the API, we have provided beta-version of functionality where support of PDF/UA standard includes two parts:
1- PDF/UA validation i.e. check of the PDF document on compatibility with PDF/UA standards.
2- Create new PDF document with appropriate tagging (tagged PDF) which is one of important requirements to make document PDF/UA compatible.
Currently, tagged text and images are supported and we are planning to extend this functionality according to the specification. The PDF/UA validation is implemented in manner similar to PDF/A validation. Below are the code snippets which demonstrate how to use PDF/UA functionality:
Check document PDF/UA compatibility
string docFilename = "example.pdf";
string logFilename = "example.xml";
Document document = new Document(docFilename);
bool isValidPdfUa = document.Validate(logFilename, PdfFormat.PDF_UA_1);
Result of document.Validate()
indicates if document is PDF/UA compatible. The log file includes the detail information about validation. Currently (In Aspose.PDF for .NET 18.9) all checks were developed and implemented except parts Font, Text (partially, involves with Font) and XObject.
Create document with tagged text
Document doc = new Document();
Aspose.Pdf.Page page1 = doc.Pages.Add();
Aspose.Pdf.Page page2 = doc.Pages.Add();
Aspose.Pdf.Page page3 = doc.Pages.Add();
//Create TextState and configure it
Aspose.Pdf.Text.TextState ts = new Aspose.Pdf.Text.TextState();
ts.Font = FontRepository.FindFont("Arial");
//Creating tagged text element
//supported tags P, H,H1-H6
TaggedPdfTextElement textElement1 = new TaggedPdfTextElement(doc, "P","text",ts);
TaggedPdfTextElement textElement2 = new TaggedPdfTextElement(doc, "P","test1",ts);
TaggedPdfTextElement textElement3 = new TaggedPdfTextElement(doc, "P","test2",ts);
TaggedPdfTextElement textElement4 = new TaggedPdfTextElement(doc, "P","test3",ts);
TaggedPdfTextElement textElement5 = new TaggedPdfTextElement(doc, "P","test4",ts);
TaggedPdfTextElement textElement6 = new TaggedPdfTextElement(doc, "P","test5",ts);
TaggedPdfTextElement textElement7 = new TaggedPdfTextElement(doc, "P","test6",ts);
TaggedPdfTextElement textElement8 = new TaggedPdfTextElement(doc, "P","test7",ts);
//Addg tagged text element to content
page1.TaggedPdfContent.Add(textElement1);
page1.TaggedPdfContent.Add(textElement2);
page1.TaggedPdfContent.Add(textElement3);
page2.TaggedPdfContent.Add(textElement4);
page2.TaggedPdfContent.Add(textElement5);
page3.TaggedPdfContent.Add(textElement6);
page3.TaggedPdfContent.Add(textElement7);
page3.TaggedPdfContent.Add(textElement8);
// Save PDF Document
doc.Save(“output.pdf”);
Create document with tagged image
Document doc = new Document();
Aspose.Pdf.Page page1 = doc.Pages.Add();
// Create image
Image image = new Image();
//Assign image file
image.File = @"image.png");
//Create BBox element
Rectangle BBox = new Rectangle(30, 70, 300, 720);
//Create tagged figure element
TaggedPdfFigureElement figureElement = new TaggedPdfFigureElement(doc,image, BBox);
Rectangle BBox1 = new Rectangle(550, 570, 300, 720);
TaggedPdfFigureElement figureElement1 = new TaggedPdfFigureElement(doc, image, BBox1);
//Add tagged figure element into content
page1.TaggedPdfContent.Add(figureElement);
page1.TaggedPdfContent.Add(figureElement1);
// Save PDF Document
doc.Save("output.pdf");
We request you to please use Aspose.PDF for .NET 18.9 in order to use above mentioned features and please share your feedback with us. It would be very helpful and valuable for us in improving and extending the functionality in future releases of the API.