Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Issue with vertical line spacing

$
0
0
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);

Viewing all articles
Browse latest Browse all 3131

Trending Articles