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

Page break with HTML tables

$
0
0
Hi. I'm trying to convert an HTML document with <table>s into PDF and I'm having an issue when a table reaches a page break (see attachment "Salto.PNG").
I'm using Aspose.Pdf 8.5.0.0.

This is the code:

using (var fs = new FileStream(fileName, FileMode.Create))
{
  var html = ""; // are the contents of html.zip
  var pdf = new Pdf(fs);
  var section = pdf.Sections.Add();

  section.PageInfo.PageWidth = Aspose.Pdf.Generator.PageSize.A4Width;
  section.PageInfo.PageHeight = Aspose.Pdf.Generator.PageSize.A4Height;

  section.PageInfo.Margin.Left = 50;
  section.PageInfo.Margin.Right = 50;
  section.PageInfo.Margin.Top = 50;
  section.PageInfo.Margin.Bottom = 50;

  section.Paragraphs.Add(new Text(section, html)
                             {
                                 IsHtmlTagSupported = true
                             });

  pdf.Close();
}

I'm attaching the source HTML and a screenshot of the resulting PDF with the error highlighted.
Thanks in advance.

José.

Viewing all articles
Browse latest Browse all 3131

Trending Articles