Pdf accessibilty tags

Hi GroupDocs,
I am trying to generate a file with accessibility tags using JAVA SDK conversion library.
Below is the code I am using to convert docx file to PDF

try(ByteArrayInputStream is = new ByteArrayInputStream(contentInBytes)) {
try (Converter converter = new Converter(() → is)) {
try (ByteArrayOutputStream ms = new ByteArrayOutputStream()) {
PdfConvertOptions convertOptions = new PdfConvertOptions();
PdfOptions pdfOptions = convertOptions.getPdfOptions();
PdfFormats pdfFormats = pdfOptions.getPdfFormat();
pdfOptions.setPdfFormat(PdfFormats.PdfA_2A);
System.out.println("PdfFormats : " + pdfFormats.toString());
//PdfFormattingOptions formattingOptions = pdfOptions.getFormattingOptions();
//formattingOptions.setDisplayDocTitle(true);
PdfDocumentInfo pdfDocumentInfo = pdfOptions.getDocumentInfo();
String pdfDocumentTitle = isBase64Encoded(title) ? new String(Base64.decodeBase64(title), StandardCharsets.UTF_8) : title;
pdfDocumentInfo.setTitle(pdfDocumentTitle);
converter.convert(ms, convertOptions);
return ms.toByteArray();
}
}
} catch (IOException e) {
System.out.println(e.getMessage());
throw e;
}

But the document is getting generated with Adobe preflight. I wanted to generate document with the pdf/a compliance tags automatically. Could you please help me with the same. Attaching the picture on accessibility tags which we want
Screenshot 2024-05-22 at 8.46.52 AM.jpg (96.4 KB)

Hi @saravanaprabhusr , let me please check this. I will let you know when done. Thanks!

I have also attached a screenshot of our requirement. Please let us know if this is supported and if it is then how to get in the Convert PDF directly

Thanks @saravanaprabhusr

Any updates on this query? It been a month now

Hi @saravanaprabhusr I will update you today

Can you please share the source docx file?

Hi @vsevolod.orefin , This is not limited any docx file as such. Let’s say if we convert a docx to pdf file we also need the accessibility tags as also part of the output PDF document like the screenshot attached.
Header 1 (1).docx (11.7 KB)

In above document we have table so we expect a TABLE , TH, TD tags in the output document

Thanks, I will check it

Please use WordProcessingLoadOptions.setPreserveDocumentStructure()
Set it to true.

           WordProcessingLoadOptions loadOptions = new WordProcessingLoadOptions();
            loadOptions.setPreserveDocumentStructure(true);
            try (Converter converter = new Converter(is, loadOptions)) {
                try (ByteArrayOutputStream ms = new ByteArrayOutputStream()) {
                    PdfConvertOptions convertOptions = new PdfConvertOptions();
                    PdfOptions pdfOptions = convertOptions.getPdfOptions();
                    PdfFormats pdfFormats = pdfOptions.getPdfFormat();
                    pdfOptions.setPdfFormat(PdfFormats.PdfA_1A);
          ..............

thanks it worked