The line-height property is not being applied in certain situations around the ordered and unordered lists. The text just before the
tag is also not receiving the line-height property. Also, the list items (- tag) inside the lists are not receiving the line-height property either.
HTML:
First line of text
Second Line of Text
- First
- Second
- Third
- Fourth
- Fifth
Text after the list.
Next line
Last line
C# Code:
Pdf pdf = new Pdf();
Section s = new Section();
Text t = new Text(“First line of text
Second Line of Text
- First
- Second
- Third
- Fourth
- Fifth
Text after the list.
Next line
Last line”);
s.Paragraphs.Add(t);
t.IsHtmlTagSupported = true;
pdf.Sections.Add(s);
pdf.Save(@“C:\src\test\test.pdf”);
Note: The example I provided is of an unordered list. I range into this problem using the ordered list as well.
Hi Philip,
Thanks for using our products and sharing the sample source code with us.
I tested the scenario using Visual Studio 2010 and Aspose.Pdf for .NET v7.0. I got 'System.StackOverflowException' exception while saving the PDF. For rectification, I logged this problem with ID: PDFNEWNET-33851 in our Issue Tracking System. We will further look into the details of this issue and will keep you updated via this forum thread on the status of correction.
Moreover, If this code is working fine at your end, kindly share the environment details i.e. Operating System, OS Architecture, .NET Framework version, Visual Studio version etc with us. This will help us to figure out the exact issue and reply back to you soon.
We apologize for your inconvenience.
Thanks & Regards,
I was using Aspose.Pdf 6.8.
After reading your message, I switch to the latest version (Aspose Pdf 7.0) and I am now receiving the same result you are.
Hi Philip,
Thank you very much for your feedback.
As mentioned in my previous post, I have already logged this issue in our issue tracking system. We will further look into the details of this issue and will keep you updated via this forum thread on the status of correction. Please be patient and spare us little time.
We apologize for your inconvenience.
Thanks & Regards,
Why this problem is not yet resolved ?
It’s really a problem for the conversion HTML to PDF.
See my example, XML containing HTML sections with condensed bullet-list.
I can’t add more spaces between lines… I set line-height on the li, added a paragraph with line-height… nothing changes!
There are a lot of problem for the layout of HTML section, each day is a surprise of new bugs!
Please, could you fix it quickly, the delay to resolve your problem is too long!
Thank you.
Hi Raphael,
Thanks for your inquiry. Please use the new DOM approach for HTML to PDF conversion; the line height issue has been fixed in it. Please check documentation link for details.
HtmlLoadOptions htmloptions = new HtmlLoadOptions();
// use the new conversion engine
htmloptions.UseNewConversionEngine = true;
// load HTML file
Document doc = new Document("lineheight.html", htmloptions);
// Save HTML file
doc.Save("HTMLtoPDFDOM.pdf");
Please feel free to contact us for any further assistance.
Best Regards,
Hi Tilal,
I use the format XML to generate the PDF file.
I tried option “HtmlInfo.UseNewHtmlConvertorForEachHtmlTextBlock = True” but the problem still the same…
I must set another property ?
Thank you
Hi Raphael,
Thanks for your feedback. I have noticed line-height tag used in XML is not working as expected, so logged the issue as PDFNEWNET-37186 in our issue tracking system for further investigation and resolution. We will notify you as soon as it is resolved. However, line-height tag is working fine in HTML to PDF conversion with DOM approach.
We are sorry for the inconvenience caused.
Best Regards,
The issues you have found earlier (filed as PDFNEWNET-33851) have been fixed in Aspose.Pdf for .NET 10.1.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.