Convert an normal word document to tagged pdf

Hi ,
I am currently generating an Word Document with Mail Merge fields , and I want to convert this word document into an Tagged/Accessible pdf . in .Net .
Thanks, and Regards

@AgileTest22 You can achieve this by saving the document with PdfCompliance.PdfUa1:

Document doc = new Document(@"C:\Temp\in.docx");

// execute your dode
// ....

PdfSaveOptions opt = new PdfSaveOptions();
opt.Compliance = PdfCompliance.PdfUa1;

doc.Save(@"C:\Temp\out.pdf", opt);

hi @alexey.noskov , Thanks for the solution .
the version i am using is Aspose.Words\v4.0_20.6.0.0 .
i am not able to find the PdfCompliance.PdfUa1 . is there no other way than upgrading to higher version or any of these will also do the work - PdfA1a , PdfA1b
thanks.

@AgileTest22 The document structure is required in PDF/A-1a, PDF/A-2a and PDF/UA-1. IF you need to use other compliance you can explicitly specify PdfSaveOptions.ExportDocumentStructure property to export document structure.

hi @alexey.noskov , What happens when the word document is not structured , and we use this code -

Document doc = new Document(@"C:\Temp\in.docx");

// execute your dode
// ....

PdfSaveOptions opt = new PdfSaveOptions();
opt.Compliance = PdfCompliance.PdfUa1;

doc.Save(@"C:\Temp\out.pdf", opt);

will it still convert it to tagged / Accessible pdf ?

@AgileTest22 MS Word is always structured, it has paragraphs, tables, shapes etc. Aspose.Words outputs this structure in PDF when you export document with PdfCompliance.PdfUa1 compliance.