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

Free Support Forum - aspose.com

HTML Ordered/Un-Ordered list not converting correctly in 7.8.0

Hi,

I am using aspose dll version 7.8.0

The following list is not getting converted properly. The bullets and text are overlapped (See Attachment).

Test Ordered List


  1. Item 1

  2. Item 2

  3. Item 3

  4. Item 4


Test Un-Ordered List


  • Diff Item 1

  • Diff Item 2

  • Diff Item 3






Please let me know how to fix it. I am using PDF X1 Reader

Hi Menaka,


Thanks for contacting support.

I have tested the scenario using Aspose.Pdf for .NET 8.0.0 using following code snippet and I am unable to notice any problem. For your reference, I have also attached the resultant PDF which is generated over my end. We are sorry for this inconvenience.

[C#]

// Instantiate an object PDF class<o:p></o:p>

Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();

// add the section to PDF document sections collection

Aspose.Pdf.Generator.Section section = pdf.Sections.Add();

// Read the contents of HTML file into StreamReader object

StreamReader r = File.OpenText(@"c:/pdftest/inputFile.html");

//Create text paragraphs containing HTML text

Aspose.Pdf.Generator.Text text2 = new Aspose.Pdf.Generator.Text(section, r.ReadToEnd());

// enable the property to display HTML contents within their own formatting

text2.IsHtmlTagSupported = true;

//Add the text paragraphs containing HTML text to the section

section.Paragraphs.Add(text2);

//Save the pdf document

pdf.Save(“c:/pdftest/inputFile_HTML2PDF.pdf”);



[HTML]

<html><o:p></o:p>

<body>

<div style="text-align: left;">

Test Ordered List<br />

<ol>

<li>Item 1</li>

<li>Item 2</li>

<li>Item 3</li>

<li>Item 4</li>

</ol>

<div>

Test Un-Ordered List<br />

<ul>

<li>Diff Item 1</li>

<li>Diff Item 2</li>

<li>Diff Item 3</li>

</ul>

<br />

<br />

</div>

</body>

</html>