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

# Save HTML as PDF 1.7 with alternate text in links

Hi,
is it possible to use Aspose Words and save HTML document with <a href="..." title="Alt text..."> ... </a> as a PDF with alternate text in links (accessibility issue) taken from title attribute?
I’ve tried it with latest Aspose Words 22.1 and it does add alternate text to links.

Thanks and Regards,
Brian

@leftofcentre You can specify PdfSaveOptions.ExportDocumentStructure option. To make Aspose.Words to export logical structure of the document for accessibility.

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

PdfSaveOptions opt = new PdfSaveOptions();
opt.Compliance = PdfCompliance.Pdf17;
opt.ExportDocumentStructure = true;

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


After enabling this option Alternate Descriptors check is passed for the generated PDF document.

Hi,
thanks for your reply. I did a test with options you suggested and I don’t see alternate text set in PDF for the link. See sample files attached in the zip file.

no alternate text screenshot (14.5 KB)

alternate-test.zip (17.6 KB)

Brian

@leftofcentre Thank you for additional information. In this case Aspose.Words behaves the same way as MS Word does. Hyperlink screentip (title from html) is exported as link annotation content:

however, I have logged your request as WORDSNET-23344, we will consider exporting hyperlink screentip as link alternative text to PDF logical structure.

The issues you have found earlier (filed as WORDSNET-23344) have been fixed in this Aspose.Words for .NET 22.2 update also available on NuGet.