Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

PDF generated with images cutting in Half when they are not part of Outermost table #4064

Open
vhogade-clgx opened this issue Aug 29, 2018 · 1 comment

Comments

@vhogade-clgx
Copy link

There is an issue of images being cut between 2 pages when the table containing images is buried deep inside another table (i.e. table withing table).

ProbalematicHTML.txt: Minimum HTML that has this issue.
ProbalematicHTML.txt

ProbalematicHTML.pdf: This is generated by providing the HTML from “ProbalematicHTML.txt”. You can see that the images at the end first page are split between 2 pages. You may use this for your testing.
ProbalematicHTML.pdf

tr, td, th, tbody, thead, tfoot {
page-break-inside: avoid !important;
}
Note that I have tried using above mentioned CSS and in fact all the tricks/hacks mentioned in below URL but none of them helped.
https://stackoverflow.com/questions/13516534/how-to-avoid-page-break-inside-table-row-for-wkhtmltopdf/13525758
Also I have tried using "page-break-inside: avoid !important;'" at appropriate elements inside innermost table having images but that didn't work either.

The only time it works is when we have images as part of outermost table. Refer below attachment that works.
Level1.txt

You may ignore other CSS classes which are referred in text file but are part of some other supporting CSS file (referred in actual page). I have tried using wkhtmltopdf.exe version 0.12.4, 0.12.5 and 0.13.0 but all of them have same issue. I would like to get a fix/workaround with 0.12.4.

Does anyone know any workaround for this one?

@talbotsk
Copy link

I've noticed the same problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants