I was happy to see that the PDFNEWNET-37636 issue was fixed in the latest release of Aspose.Pdf for .NET (10.1.0). Unfortunately the HTML to PDF conversion seems to be broken in this new version.
With the previous version of Aspose.Pdf for .NET, the following code produces a PDF file with 5 pages with a header on each page.
With the 10.1.0 version of Aspose.Pdf for .NET, only the 2 first pages comes out as expected, page 3 and forward are all blank(!)
String html = “”; html += “”; html += “”; html += “.page { width: 210mm; height: 297mm; margin: 0; padding: 0; }”; html += “”; html += “
Thanks for your inquiry. We have tested your source code and noticed missing text last three pages. We have logged a ticket PDFNEWNET-38255 in our issue tracking system for further investigation and resolution. We will keep you updated about the issue resolution progress.
Moreover, can you please confirm in which Aspose.Pdf for .NET this code was working as expected. It will help us to investigate the issue.
Thank you for your response. I think I'll have to take back my statement about this working in a previous version (v 9.4.0.0) though. After some more testing we see the same behaviour in both versions. We have just also found a work-around, which is to remove the body margin and padding:
html += "body { margin: 0; padding: 0; }"; // PUT BETWEEN STYLE TAGS There's still seems to be a bug though, since saving this html code as PDF in Chrome (from the Print dialogue) produces a correct PDF with text on all 5 pages.
I think I'll have to take back my statement about this working in a previous version (v 9.4.0.0) though. After some more testing we see the same behaviour in both versions.
Thanks for confirming that it is not a regression issue.
pigetto:
We have just also found a work-around, which is to remove the body margin and padding:
html += "body { margin: 0; padding: 0; }"; // PUT BETWEEN STYLE TAGS There's still seems to be a bug though, since saving this html code as PDF in Chrome (from the Print dialogue) produces a correct PDF with text on all 5 pages.
Thanks for your finding. We have also passed it to our development team and they will be considered this information in issue investigation and resolution.