We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Accesibility not avaliable in when converting from word to pdf

I’m using aspose for .NET but I’m unable to use generate a pdf from word where accessibility text is avaliable on pictures. The file i want to convert: test.docx (39.0 KB)

I have tried to use your online converter: https://products.aspose.app/words/conversion, where it does not work either.

My code:

Aspose.Words.Saving.PdfSaveOptions options = new Aspose.Words.Saving.PdfSaveOptions();
options.SaveFormat = Aspose.Words.SaveFormat.Pdf;
options.ExportDocumentStructure = true;
options.PreserveFormFields = true;

Aspose.Words.Document document = new Aspose.Words.Document(stream);
var fileStream = fileStreamService.CreateFileStream();
document.Save(fileStream, options);
fileStream.Flush();
return fileStream;

I still have trouble creating a pdf document from word. Im trying to convert this filetest.docx (39.0 KB)

My code looks like this:

Aspose.Words.Saving.PdfSaveOptions options = new Aspose.Words.Saving.PdfSaveOptions();
options.SaveFormat = Aspose.Words.SaveFormat.Pdf;
options.ExportDocumentStructure = true;
options.PreserveFormFields = true;
options.Compliance = Aspose.Words.Saving.PdfCompliance.PdfA2a;

Aspose.Words.Document document = new Aspose.Words.Document(stream);
var fileStream = fileStreamService.CreateFileStream();
document.Save(fileStream, options);
fileStream.Flush();
return fileStream;

Can you generate a pdf document where it is possible to read the alt-text from the picture?

@DonSpaghetti As I can see alternative text of the image is properly exported to PDF. Please see the attached screenshot from Adobe Reader:

And from PAC3:

Could you please further elaborate your requirements?

I have trouble to read the alternate text with a tool like NVDA. Do i need to set another option to enable this?

@DonSpaghetti Looks like the problem is with NVDA software. Could you please make sure it can read alt text from PDF produced for example by MS Word?

@alexey.noskov NVDA works fine when I’m saving the same .docx as a pdf inside Word.

@DonSpaghetti Could you please share, where I can get the software you are using for testing? We will check the issue and provide you more information.

@alexey.noskov I’m using this tool: https://www.nvaccess.org/download/.

From what i can gather it is a standard tool used by testers.

@DonSpaghetti Thank you for additional information. But unfortunately, I cannot reproduce the problem on my side. When I open the PDF document generated by Aspose.Words in Adobe Acrobat reader and navigate in it NVDA properly reads alt text of the image and pronanciate it.

How do you convert the .docx file to pdf?

@DonSpaghetti Here if the code used for conversion:

Document doc = new Document(@"C:\Temp\in.docx");
PdfSaveOptions opt = new PdfSaveOptions();
opt.ExportDocumentStructure = true;
opt.Compliance = PdfCompliance.PdfA2a;
doc.Save(@"C:\Temp\out.pdf", opt);

And here is the output PDF produced on my side: out.pdf (53.3 KB)

Thanks, that fixed my issue

1 Like