-
Notifications
You must be signed in to change notification settings - Fork 5.7k
In V2.0.0 html table heading not repeated across pages in PDF #13324
Comments
This has been done a few times before[0][1], but seems to be broken again as reported in [2]. This commit is only reinstating what's missing from [1]. This was done by running: git log -p -1 2d778f6 | git apply -3 -p6 --directory=src/qt/qtwebkit And resolving the conflicts. There are still some compile errors. These will be fixed in the upcoming commits instead of in this one to clarify the changes. This change doesn't completely fix the issue. The thead/tfoot block is drawn again on the next page, however the other content is not shifted down accordingly. This means that the thead/tfoot block on the next page will be placed on top of the continued table instead of above it. [0]: ariya#211 [1]: ariya#344 [2]: ariya#13324
This has been done a few times before[0][1], but seems to be broken again as reported in [2]. This commit is only reinstating what's missing from [1]. This was done by running: git log -p -1 2d778f6 | git apply -3 -p6 --directory=src/qt/qtwebkit And resolving the conflicts. There are still some compile errors. These will be fixed in the upcoming commits instead of in this one to clarify the changes. This change doesn't completely fix the issue. The thead block is drawn again on the next page, however the other content is not shifted down accordingly. This means that the thead block on the next page will be placed on top of the continued table instead of above it. The tfoot block is also repeated and seems to work as expected. [0]: ariya#211 [1]: ariya#344 [2]: ariya#13324
I discovered this issue as well, and saw that it has been addressed a few times before: #211 #344. I saw that some of what #344 added was missing in master, and tried readding that. This makes the header/footer appear on the next page. However, the other content is not shifted down, so the header appears on top of the table on the next page, instead of above it. What I have done so far is available here: https://github.com/trygveaa/phantomjs/tree/repeat-thead-tfoot-page-break |
This has been done a few times before[0][1], but seems to be broken again as reported in [2]. This commit is only reinstating what's missing from [1]. This was done by running: git log -p -1 2d778f6 | git apply -3 -p6 --directory=src/qt/qtwebkit And resolving the conflicts. There are still some compile errors. These will be fixed in the upcoming commits instead of in this one to clarify the changes. [0]: ariya#211 [1]: ariya#344 [2]: ariya#13324
This fixes the last errors after 218a937. I have confirmed that both the thead and the tfoot blocks are repeated on the next pages when a table breaks over multiple pages. The other content was already moved to take account of the size of thead and tfoot, so this change doesn't affect any other content. This fixes issue ariya#13324. ariya#13324
Correction: It seems like the problem with the header overlapping the table was because of some css styles in the page I was testing. I tested with a page without styles. For this page, everything seems to be correctly drawn. |
Thanks @trygveaa. I assume this means that I have to download your source and build it myself? When will the fix make it into the standard build? |
Yes, if you want it now, you have to build it yourself. If you're asking me, I don't know when it will be included (I don't have any relation to phantomjs). I opened pull request #13331, so we will just have to wait and see. |
Hello Trygve, I finally got around to building my own PhantomJS with your patch. But I am seeing that the table header overlaps with the page content. Please see (https://cloud.githubusercontent.com/assets/5335605/8824069/eca9bfda-308f-11e5-86c0-e3193ffe55de.png). Any ideas what could be wrong?
|
This fix for ariya/phantomjs#13324 is an adaptation of ariya/phantomjs#13331 modified for the new submodule linking of QtWebKit used starting 2.1.0. I am not the author of the original patch (@trigveaa is) nor am I competent enough with the QtWebKit codebase to fully endorse it. All I know is that this patch seems to fix the issue for my use-case (aside from the page header overlap I reported in ariya/phantomjs#13331).
Do you have binaries for Windows? |
@rwankar: Hi, sorry for not replying to you. I didn't need this after all, so I lost a bit of interest, and then forgot about it. I also experienced that overlapping issue when I tested my patch. Though, I tried with a page without any CSS, and then I didn't experience the problem. So I'm not sure what the problem is, and if it's a bug with my patch or if it can be fixed with CSS. I haven't investigated this further, so can't help you with it unfortunately. @szdmr: I assume you mean binaries with my patch, since you ask here? I don't have it at least, and would doubt anyone else has. |
Any updates on this? We are experiencing this when using https://github.com/marcbachmann/node-html-pdf |
@sonu27 @rwankar I fixed this issue based on 2.1.1 since the latest version 2.5 does not work at all when rendering PDF. If you want this feature the binaries are here: (https://github.com/JoeyLi-1/phantomjs-1) release 2.1.15. source code: (https://github.com/JoeyLi-1/qtwebkit) if you are interested). I might create a PR in main branch if I could figure out how to work with the phantom - 2.5 |
+1 |
@JoeyLi-1 thanks for the update. I'll give this a try. |
Due to our very limited maintenance capacity (see #14541 for more details), we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed. In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution! |
In version 1.9.8 the row was repeated on each page without any special setting. What do I need to do to get the same in 2.0?
The text was updated successfully, but these errors were encountered: