Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.
Fri Jan 10, 2020 9:40 am
Hi Support Team,
I use the function of html convert to pdf with new plugin. However, I found an issue that some contents are broken (like there are words/tables/image broken into two pages)
Thanks for your inquiry. Please provide your following information for further investigation: 1. The input HTML 2. The code you were using 3. The result you got
I am using this code, Spire.Pdf.HtmlConverter.Qt.HtmlConverter.Convert(htmlString2, "C:\\ile1s2kr.kh5 test.pdf",false, 100 * 1000,new SizeF(792, 612), new Spire.Pdf.Graphics.PdfMargins(10, 5),LoadHtmlType.SourceCode);
Please check the attached 'testcase.html' for the first input html.
The text is cut into half between two page break, pls refer to attached 'ile1s2kr.kh5 test.pdf' between 2nd and 3rd page.
Thanks for your information. I tested your file and did notice the issue you mentioned, I have logged it into our bug tracking system, once there is any progress, we will inform you. Sorry for the inconvenience caused.
FYI, i have purchased the Spire.PDF Pro Edition license this year to use this pdf library. If it doesn't fulfill our needs, we will find alternative solution other than this software in the furture
Sorry that we don't find the purchased information related to your register email. Could you please tell us your order number or purchase email?
As for the cut issue you submitted, after further investigation, we found there is no "page" concept in HTML theoretically. But for PDF, you set the page with fixed size, that means the content will be divided into many pages with the setting size. It is normal phenomenon if the content/texts are cut with fixed size. We suggest you change the size of PDF page to avoid the cut issue. After testing, I found that the text would not be cut with the page size "new SizeF(792, 1590)". Hope you could understand.
The license was purchased with our team email sam@visa.com
I have tried your proposed solution, it doesn't work. Pls refer to the attached file, a table row is cut into half between page 2 and page 3.
And I don't think the issue is caused by no 'page' concept in html mentioned in your previous post. Instead, when generating the pdf from the html, the spire should detect the text/table row/image etc and calculate if the remaining space within the current page can fix the component. If the component cannot fix in the current page, they should be shown as a whole in next page.
Thanks for your following up. Actually, our plugin conversion method is based on the Qt plugin of the Chrome kernel. I used Chrome to directly convert the your HTML file to PDF and found the text was also cut off between the two page breaks. You could verify it in your side. Meanwhile, our Dev team has also conducted a series of in-depth investigations, but sorry to tell that there is no good solution at present. Apologize for the inconvenience caused.