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

Free Support Forum - aspose.com

Accessibility in aspose pdf.. screen reader not reading values properly

Hi Team,

I have a paid version of ASPOSE PDF. I have a pdf generated from HTML.
and the data is looking in the below specified format.

Name FileName
Adithya Test.html

it should ideally read as Name, Adithya and FileName, Test.html. But instead its reading as Name, Filename, Adithya, Test.html. i have also attached the code for the same.

Second issue - Images are not getting read out (even though after having alt tag for image)

<table style="table-layout: fixed;width:100%;">
                                        <caption style="color:#0575D1;font-size: 15px;line-height: 20px;font-weight: bold;text-align: left;padding-bottom: 15px;">Data</caption>
                                        <tr>
                                            <td colspan="3">
                                                <table style="table-layout: auto;width:100%;font-size: 14px;border-collapse: collapse;color:#424342">

                                                    <tbody>
                                                        <tr>
                                                            <td style="padding-bottom:20px;">
                                                                <label style="color:#919191; line-height:20px;">Project Title</label>
                                                                
                                                                <div style="line-height: 20px;">ProjectName</div>
                                                                
                                                            </td>
                                                            <td style="padding-bottom:20px;">
                                                                <label style="color:#919191;line-height: 20px;">File Name</label>
                                                                
                                                                <div style="line-height: 20px;">FileName</div>
                                                                
                                                            </td>
                                                            <td style="padding-bottom:20px;">
                                                                <label style="color:#919191;line-height: 20px;">Roll number</label>
                                                                
                                                                <div style="line-height: 20px;">RollNumber</div>
                                                                
                                                            </td>
                                                        </tr>
                                                  
                                                    </tbody>
                                                </table>
                                            </td>

                                        </tr>
                                    </table>

@adithya_sai

Would you please share the sample code snippet that you are using to convert the HTML. We will test the scenario in our environment and address it accordingly.

testaspose.zip (2.3 KB)

I have uploaded the html file that i am using to generate pdf… and i have commented image tags… u can add some url in that image tag and try generating pdf.
Here are the three issues -

  1. Table is not recognized as a table… its just reading the horizontal lines
  2. Images are not recognized
  3. Section which has details are not reading properly

@adithya_sai

Thanks for sharing sample file.

As requested earlier, would you kindly share the code snippet as well which you are using to generate PDF so that scenario can be tested and addressed accordingly.

here is the code for generating that

public static async Task GeneratePDF(string content, string headerRightText = “”, string footerLeftText = “”)
{
string htmlString = content;
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense(“Aspose.Pdf.lic”);
license.Embedded = true;
HtmlLoadOptions objLoadOptions = new HtmlLoadOptions();
objLoadOptions.PageInfo.IsLandscape = false;
objLoadOptions.PageInfo.Margin = new MarginInfo(0, 0, 0, 0);
objLoadOptions.PageInfo.Width = 1100;
MemoryStream memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(htmlString));
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(memoryStream, objLoadOptions);
memoryStream.Dispose();

        doc.ProcessParagraphs();

        MemoryStream outputStream = new MemoryStream();
        doc.Save(outputStream, SaveFormat.Pdf);
        return new FileStreamResult(outputStream, "application/pdf");
    }

@adithya_sai

The HTML that you have shared did not have any refrenced images however, we noticed that output PDF was not well-formatted. output.pdf (72.9 KB)

We have logged an issue for poor formatting of generated PDF in our issue tracking system as PDFNET-48656. We will further look into its details and keep you posted with the status of its rectificaiton. Please be patient and spare us some time.

We are sorry for the inconvenience.