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

In V2.0.0 html table heading not repeated across pages in PDF #13324

Closed
rwankar opened this issue Jun 15, 2015 · 12 comments
Closed

In V2.0.0 html table heading not repeated across pages in PDF #13324

rwankar opened this issue Jun 15, 2015 · 12 comments
Labels

Comments

@rwankar
Copy link

rwankar commented Jun 15, 2015

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?

trygveaa added a commit to trygveaa/phantomjs that referenced this issue Jun 16, 2015
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
trygveaa added a commit to trygveaa/phantomjs that referenced this issue Jun 16, 2015
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
@trygveaa
Copy link

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

trygveaa added a commit to trygveaa/phantomjs that referenced this issue Jun 16, 2015
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
trygveaa added a commit to trygveaa/phantomjs that referenced this issue Jun 16, 2015
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
@trygveaa
Copy link

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.

@rwankar
Copy link
Author

rwankar commented Jun 17, 2015

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?

@trygveaa
Copy link

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.

@rwankar
Copy link
Author

rwankar commented Jul 22, 2015

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?

On 17-Jun-2015, at 3:40 pm, Trygve Aaberge [email protected] wrote:

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 #13331, so we will just have to wait and see.


Reply to this email directly or view it on GitHub #13324 (comment).

svvac added a commit to svvac/qtwebkit that referenced this issue Mar 7, 2016
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).
@szdmr
Copy link

szdmr commented Apr 6, 2016

Do you have binaries for Windows?

@trygveaa
Copy link

trygveaa commented Apr 6, 2016

@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.

@sonu27
Copy link

sonu27 commented Mar 8, 2017

Any updates on this? We are experiencing this when using https://github.com/marcbachmann/node-html-pdf

@JoeyLi-1
Copy link

JoeyLi-1 commented Jul 4, 2017

@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

@krutkowski86
Copy link

+1

@rwankar
Copy link
Author

rwankar commented Dec 13, 2017

@JoeyLi-1 thanks for the update. I'll give this a try.

@stale stale bot added the stale label Dec 26, 2019
@stale
Copy link

stale bot commented Dec 29, 2019

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!

@stale stale bot closed this as completed Dec 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants