Issue with vertical line spacing

I am using the .Net version Apose.PDF to render a PDF from some dynamically generated html for a current project. After I ran into some issues with the creation of columns using divs I tried using tables as an alternative.


The problem I am having is that although the spacing is correct on the html the PDF has what appears to be random spacing when there is a significant amount of text within the cell of a table.

I have included an example html file with the corresponding css for style and I am using the new method of PDF generation as suggested in many of the recent posts and I am using the latest version as of 3/12/15

Is there a known issue with vertical spacing - if so is there a fix scheduled?
Is there anything else I can do to resolve this issue?

Thank you

Here is the code for the conversion (the HTML is passed as a string to the html variable and the absolute base file path is passed to the externalFilePath variable):

// set the html options
HtmlLoadOptions htmlOptions = null;
if (externalFilePath == null)
htmlOptions = new HtmlLoadOptions();
else
htmlOptions = new HtmlLoadOptions(externalFilePath);

htmlOptions.PageInfo.Margin.Top = 20;
htmlOptions.PageInfo.Margin.Right = 20;
htmlOptions.PageInfo.Margin.Bottom = 20;
htmlOptions.PageInfo.Margin.Left = 20;
htmlOptions.PageInfo.IsLandscape = false;
htmlOptions.PageInfo.Width = Aspose.Pdf.PageSize.A4.Width;
htmlOptions.PageInfo.Height = Aspose.Pdf.PageSize.A4.Height;

// Pass the HTML into a new Document object
Document doc = new Document(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(html)), htmlOptions);

// Save PDF stream
doc.Save(outputPdfStream);

Hi Andrew,


Thanks for using our API’s.

I have tested the scenario using following code snippet with Aspose.Pdf for .NET 10.2.0 and I am unable to figure out the problem. Do you mean the column width is not being honored when HTML to PDF format ? as I am unable to notice the vertical line spacing issue. For your reference, I have also attached the resultant PDF generated over my end.

[C#]

//
set the html options
<o:p></o:p>

HtmlLoadOptions htmlOptions = null;

htmlOptions = new HtmlLoadOptions(@"C:\pdftest\vertical+spacingl\");

htmlOptions.PageInfo.Margin.Top = 20;

htmlOptions.PageInfo.Margin.Right = 20;

htmlOptions.PageInfo.Margin.Bottom = 20;

htmlOptions.PageInfo.Margin.Left = 20;

htmlOptions.PageInfo.IsLandscape = false;

htmlOptions.PageInfo.Width = Aspose.Pdf.PageSize.A4.Width;

htmlOptions.PageInfo.Height = Aspose.Pdf.PageSize.A4.Height;

// Pass the HTML into a new Document object

Document doc = new Document(@"C:\pdftest\vertical+spacingl\documentHTML.html", htmlOptions);

// Save PDF stream

doc.Save(@“C:\pdftest\vertical+spacingl\documentHTML.pdf”);

I have attached a screenshot that shows the issue. Notice the space between some lines in the rendered pdf whereas the expected behavior is for each line to be equally spaced the same as the html screenshot


How can we unsure that the html and pdf look similar?

Thank you

Hi Andrew,


Thanks for sharing the details.

<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif””>I
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-38380. We
will investigate this issue in details and will keep you updated on the status
of a correction. <o:p></o:p>

We apologize for your inconvenience.

I noticed from the latest release notes that this issue is still to be resolved.


Do you have an estimation of the timeline for this defect?
Is it on the agenda for the next release?

Unfortunately this problem is proving to be quite a set back to the project and has also prevented the purchase of Aspos.Barcde for .Net until the issue with PDF is resolved.



I look forward to your reply.

Hi Andrew,


Thanks for your feedback. I am afraid your issue is reported issue is still not resolved and it is pending for investigation in the queue with other issues already under investigation/resolution. However we have recorded your concern and shared with our Product team. We will keep you updated about the issue resolution progress.

We are sorry for the inconvenience caused.

Best Regards,

The issues you have found earlier (filed as PDFNEWNET-38380) have been fixed in Aspose.Pdf for .NET 10.6.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.