Edit structure element tag in PDF U/A document

Hello

I have a word document which I convert to a PDF using Apose.Words with the following code:

var wordDocument = new Aspose.Words.Document(inputStream);
var pdfOptions = new Aspose.Words.Saving.PdfSaveOptions
{
	Compliance = Aspose.Words.Saving.PdfCompliance.PdfA1a,
	DisplayDocTitle = true,
	OutlineOptions =
	{
		CreateOutlinesForHeadingsInTables = true,
		HeadingsOutlineLevels = 9,
		ExpandedOutlineLevels = 9
	}
};

wordDocument.Save(wordOutputStream, pdfOptions);

To get a PDF U/A compliance i convert the PDFafterwards with Aspose.Pdf with the following code:

var pdfDocument = new Aspose.Pdf.Document(wordOutputStream);
pdfDocument.Convert(new MemoryStream(), Aspose.Pdf.PdfFormat.PDF_UA_1, Aspose.Pdf.ConvertErrorAction.Delete);
pdfDocument.Save(pdfOutputStream);

This works pretty good, expect that I get a warning in the logical structure of my final PDF document:

"Part" structure element used as root element.

The issue is, that the first structure element in the logical structure (pdfDocument.LogicalStructure.Children[0]) is a “Part” element (tag=Part) but according to the PDF U/A specification it should be a “Document” element (tag=Document).

So my question: Is it somehow possible to change the tag of this structure element? Or is this a known issue in Aspose.Pdf and you will fix this in an upcoming version? I’m using the current version 18.11.0 of both products.

Thanks for your help!

@aquasonic

Thanks for contacting support.

Please note that features for creating and modifying PDF/UA documents are currently under development and we surely intend to provide complete functionality to create as well as modify PDF/UA files in future version(s) of the API. Would you please provide us your sample Word document and final output PDF along with screenshot of warning you mentioned. We will definitely test the scenario in our environment and address it accordingly.

Thanks for the reply.

Of course, please find the word, the final pdf and the screenshot in the attached. sample.zip (252.6 KB).

I did the accessibility check with the PAC 3 tool which you can download [here](https://www.access-for-all.ch/ch/pdf-werkstatt/pdf-accessibility-checker-pac/download-pac-3.html). There is also an additional error in the screenshot and in the tool. This is because of the missing license string at the top. So when adding a valid license this should disappear :slight_smile:

Thanks for looking into it and keep me updated.

@aquasonic

Thanks for sharing requested details.

We have tested the scenario in our environment and observed the issue. We have logged all provided details under the ticket ID PDFNET-45672 in our issue tracking system. These details would definitely be helpful in implementing the new feature. As soon as some updates are available in this regard, we will let you know within this forum thread. Please spare us little time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFNET-45672) have been fixed in Aspose.PDF for .NET 18.12.