Hi,
I am converting HTML TO PDF using Aspose.PDF package. My table row is getting split between pages of generated PDF. Same issue was earlier reported by one of the user on your forum with Issue ID (PDFNET-56889) and it was reported to be fixed in version 24.8.0 of Aspose.PDF. I am using same version also checked with latest version i.e. 25.2.0 but the issue is not fixed.
RowSplitCode.docx (14.3 KB)
output.pdf (78.1 KB)
Can you please check the issue at your end and update us about the fix.
@psuryavanshiagy
Looks like you are actually converting HTML to PDF using Aspose.HTML and only using Aspose.PDF to save the file in memory. With Aspose.PDF, we tested using below code snippet:
string html = File.ReadAllText(dataDir + "testfile.html");
var byteArray = Encoding.UTF8.GetBytes(html);
using (var inStream = new MemoryStream(byteArray))
{
var options = new HtmlLoadOptions()
{
// set Print or Screen mode
HtmlMediaType = HtmlMediaType.Print,
IsEmbedFonts = true,
IsRenderToSinglePage = true,
PageInfo = new PageInfo() { Margin = new MarginInfo(0, 0, 0, 0), Width = PageSize.A4.Height, Height = PageSize.A4.Width }
};
using (var document = new Document(inStream, options))
{
//document.Flatten();
document.Save(dataDir + "output.pdf");
}
}
Please check the attached output and let us know if you notice any issues in it. We will further proceed to assist you accordingly.
output.pdf (73.4 KB)
Yes, I am using Aspose.HTML to convert HTML to PDF. In my example row is getting split between pages I want to avoid that. In the example you have provided you are converting all the html on single page( IsRenderToSinglePage = true) in PDF document. Can you please try my example and repro the issue. My generated PDF will contain multiple pages.
@psuryavanshiagy
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): HTMLNET-6166
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.