Hello Aspose Support Team,
We are currently utilizing Aspose.PDF to convert HTML documents, which are compliant with WCAG 2.1 standards, into PDFs as part of our solution. However, we’ve encountered an issue where the resulting PDFs do not adhere to the WCAG 2.1 requirements, particularly concerning accessibility features.
Key Issues Noted:
• Lack of Tagging for Headings: The converted PDFs do not include tagged heading elements. This omission disrupts the logical order when using screen readers, making navigation difficult for users with visual impairments.
• Missing Alternative Text for Images: Images in the resulting PDFs lack alternative text, which causes screen readers to ignore these images, thereby omitting crucial information meant for visually impaired users.
Given these challenges, the accessibility of our PDFs is significantly compromised, which is a critical concern for us in serving our users with disabilities effectively.
We hold an Aspose.Total license and are keen on utilizing Aspose as our comprehensive solution for document conversion. We would greatly appreciate your guidance on how we can resolve these issues to ensure our PDF outputs are fully compliant with WCAG 2.1 standards.
Could you please provide:
• Any specific settings or methods within Aspose.PDF that we should use to maintain WCAG 2.1 compliance during conversion?
• Any updates or patches that address these accessibility features?
• Best practices or recommendations for generating accessible PDFs using Aspose tools?
We will need to investigate this whole scenario. If possible, can you please share a sample HTML file along with sample code snippet that you are using? We will log an investigation ticket and share the ID with you.
Here is a code example that has been used with the Dagsorden.html file that I have attached (zipped). The file contains alternative texts, for instance, which are not tagged in the PDF:
private async Task ConvertHtmlToPdf(MemoryStream htmlStream, MemoryStream pdfStream, IList<BilagInfo> bilagInfoList, CancellationToken token)
{
AsposeLicense.EnsureLicenseInitialized();
HtmlLoadOptions options = new HtmlLoadOptions { HtmlMediaType = HtmlMediaType.Print };
Document pdfDocument = new Document(htmlStream, options);
await AddBilagToPdfDocument(pdfDocument, bilagInfoList, token);
pdfDocument.Save(pdfStream);
}
private async Task<Document> AddBilagToPdfDocument(Document pdfDocument, IList<BilagInfo> bilagInfoList, CancellationToken token)
{
foreach (var bilag in bilagInfoList)
{
using (var bilagStream = new MemoryStream())
{
await _bilagService.GetData(bilag.Behandling.Id, bilag.Bilag.Id, bilagStream, token);
var fileSpecification = new FileSpecification(bilagStream, bilag.FileNameWithExtension);
pdfDocument.EmbeddedFiles.Add(fileSpecification);
}
}
return pdfDocument;
}
Dagsorden.zip (9.9 KB)
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PDFNET-57608
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.