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

Free Support Forum - aspose.com

HTML to PDF issue rendering unordered list to match HTML

My list (unordered list) is not rendering with an indent as the HTML display does. I have tried setting multiple style attributes to get the desired effect but it is not changing the indent. Below is the HTML:

<div style="font-family: Arial; font-size: 10pt">

<ul style="list-style-position:inside; font-family: Arial; font-size: 10pt" >


list Item One



List item for <input style="font-family: Arial; font-size: 10pt" title="Name" maxlength="200" name="Name" type="text" /> and/or,



List Item Three.




I have also tried setting the margin, padding, included the list in div as above and without a div and the list keeps getting justified to the left. Is there a known workaround to get the properly WYSIWYG in PDF as in HTML?


Hi Dave,

Thank you for considering Aspose.

Please download and try the latest version of Aspose.Pdf for .NET v6.4.0 from the following link and check if it works fine. If you still face the issue, please share the template html file, resultant PDF file and the sample code to reproduce the issue. We will check it and get back to you soon.


Thank You & Best Regards,

Still same issue with the indentation. The bullets do look better with regard to spacing between the bullet and the text, but same issue exists that no indention occurs. The PDF is not rendered same as HTML is rendered with the indent. The specific style setting ("list-style-position: inside) is supposed to render the bullets with an indent as it does in HTML. Please see attached HTML file and also the attached PDF in ZIP file. Below is the code utilized to create the PDF:

public void HTMLToPDF(String strHTML, String pdfFileName)


Aspose.Pdf.License pdfLic = new Aspose.Pdf.License();


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

//Need to be exposed as Properties:

pdf.PageSetup.PageWidth = 612F;

pdf.PageSetup.PageHeight = 792F;

pdf.PageSetup.Margin.Top = 21.6F;

pdf.PageSetup.Margin.Bottom = 54F;

pdf.PageSetup.Margin.Left = 72F;

pdf.PageSetup.Margin.Right = 72F;

// 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

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

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

text2.IsHtmlTagSupported = true;

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


// Specify the URL which serves as images database

String strPath = Path.GetDirectoryName(pdfFileName);

pdf.HtmlInfo.ImgUrl = strPath;

//Save the pdf document



Please let me know if you need anything else to aid in your fix of this issue. Thanks.

Hi Dave,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for sharing the sample code and template file and sorry for a delayed reply.

We have found your mentioned issue after an initial test. Your issue has been registered in our issue tracking system with issue id: PDFNEWNET-31968. We will notify you regarding any update against your issue via this forum thread.

Sorry for the inconvenience,

The issues you have found earlier (filed as PDFNEWNET-31968) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.