HtmlToPdfConverter - Last row in html table is cut of after page break

Hi,

we use the version 24.1.45 of the HtmlToPdfConverter to convert invoices build in Html.
All works quit good. But we have a case that a page break is added in an Html table. And when this happen the last row of the table is cut off. This you can see in the screenshot:

When no page break happens all looks as  expected.
I attached the Html and the pdf to this ticket.

What can we do to avoid this behavior in the last row?

Thank you very much.
Best

 Sven



Attachment: Archive_a1f8b375.zip

13 Replies

KS Karmegam Seerangan Syncfusion Team January 18, 2024 02:35 PM UTC

Hi Sven,

 

Thank you for contacting Syncfusion support.

We are unable to reproduce the reported issue on our end. However, we have attached the sample and output for your reference.

 

Sample:  https://www.syncfusion.com/downloads/support/directtrac/general/ze/HtmlToPDF_Blink-989594227

Output:  https://www.syncfusion.com/downloads/support/directtrac/general/ze/outputDoc-1439155469

 

Kindly try the sample and let us know the result. If still you are facing issues, we kindly request you to share the modified sample, complete code snippet, package name, package version, and environment details (OS, RAM, bit version and culture settings) to check this on our end. It will be helpful for us to analyze and assist you further on this.

 

Regards,

Karmegam



SB Sven Boris Bornemann January 19, 2024 10:23 AM UTC

Hi Karmegam,

thank you very much.

I tested your solution and added my settings to it. The Project is attached. 
I could find the difference and the issue happens when you add the setting MediaType = MediaType.Print.


We use this setting because we want to show up the table header after a page break again. 

Is their a way to fix it?


Best 

Sven


Attachment: pdf_test_a4d2465c.zip


KS Karmegam Seerangan Syncfusion Team January 22, 2024 04:25 PM UTC

Thank you for providing the sample project.


We are able to reproduce the reported issue on our end. Currently, we are validating this and will update further details on January 24th, 2024.




KS Karmegam Seerangan Syncfusion Team January 24, 2024 05:55 PM UTC

The reported issues still need a lot more in-depth research; thus we are looking into them. On January 25th, 2024, further information will be updated.



KS Karmegam Seerangan Syncfusion Team January 25, 2024 01:30 PM UTC

On our further validation, we have internally using Chrome headless browser for converting HTML to PDF in our Blink converter. It will preserve the PDF document like how the input HTML/URL is displayed in the Chromium-based web browsers (chrome, print preview).  The text cut-off issue occurs in the Chrome print preview itself with the provided input HTML file.

However, as a workaround, we have modified the input HTML file to adjust the table content and preserve the text properly. We have attached the output pdf, modified HTML, and sample for your reference,

 

Output: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Output_7218198295

Modified HTML: https://www.syncfusion.com/downloads/support/directtrac/general/ze/526-638410037208257144-154118628

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/pdf_test-30679404

 

Kindly try the provided sample and let us know the result.



UN Unknown January 26, 2024 09:02 AM UTC

Hey, 

thanks for the response, the clarification about the cause and the presented workaround! 

What exactly was the change you did to preserve the text in the table? We need to know what we have to modify in our code. Our customers create many files per day and we need a solution to implement in our html generation code. So when we have other html documents that they also look good on pdf.


Kind regards 




KS Karmegam Seerangan Syncfusion Team January 29, 2024 11:50 AM UTC

We have attached the modified content in HTML files screenshots for your reference. 

image

image



Please let us know if you need further assistance on this.




SB Sven Boris Bornemann January 29, 2024 01:23 PM UTC

Hi,

thanks for the answer. Is there no other way as manipulating the html? Because this is very dynamic and every invoice look different.

Also your solution breaks the table header background, as you can see in the screen shot.


Best 

Sven



SB Sven Boris Bornemann January 29, 2024 01:42 PM UTC

I now run the code with you updated html and compared it to the old one.

I do not see any improvement. The result is even worse.



KS Karmegam Seerangan Syncfusion Team January 31, 2024 01:31 PM UTC

Upon further analysis, the Blink rendering engine internally uses a chrome headless browser for converting HTML to PDF. It will preserve the PDF document like how the input HTML/URL is displayed in chromium-based web browsers (chrome, print preview). The same behavior was replicated in our converter.

The reported issue occurs from the Blink rendering engine itself. We have ensured this by setting the same margin in the Chrome print preview. We have attached a screenshot for your reference.

 

 

Please make the necessary changes to your input HTML according to your requirements and ensure it by using the Chrome print preview feature.



SB Sven Boris Bornemann February 1, 2024 08:09 AM UTC

Ok, this means I need to open a Bug Ticket on the Google Blink Platform?



SB Sven Boris Bornemann February 1, 2024 09:27 AM UTC

Actually we found the issue. There was an overflow: hidden set in our css.

Thanks for your help.


Best Sven



KS Karmegam Seerangan Syncfusion Team February 1, 2024 02:54 PM UTC

We are glad to hear that issue has been resolved on your end. please let us know if you need any other assistance.


Loader.
Up arrow icon