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

Big white space before nested table #2098

Closed
subhimarabeh opened this issue Dec 11, 2014 · 8 comments
Closed

Big white space before nested table #2098

subhimarabeh opened this issue Dec 11, 2014 · 8 comments

Comments

@subhimarabeh
Copy link

Hi All,
i am facing a problem when i am trying to convert html to pdf with nested table, a large white space appeared before the nested table, i read all issues posted here before nad nothing worked for me,
my html file http://en.file-upload.net/download-9983610/temp.html.html,
my resulted pdf http://en.file-upload.net/download-9983634/Quote__20141020-002._-LHR-_London__GB_-__-DFW-_Dallas-Fort_Worth__US--21-.pdf.html
ps: i am using the lastest version of the library
please help me, any help would be much appreciated thanks

@ashkulz
Copy link
Member

ashkulz commented Dec 12, 2014

Please post the exact version/platform you are using and include the HTML and screenshot of PDF here. The link you gave me pushes you to download an EXE which looks very fishy.

@subhimarabeh
Copy link
Author

@ashkulz sorry for inconvenience, i uploaded both the html and PDF at:
1- the resulted pdf: https://drive.google.com/file/d/0B2dDW5rR56qsSUl2eGh4dG0xdzA/view
2- the webpage that i am trying to download note i send the html for the library not the url:
http://1-8-0-12793-2192-subhi.tradeos-test4.appspot.com/?auth=hf7JU5k8qSUiIBMDqAaS4fhM1fo#!freightTrade/FreightDraftQuote/view~id=ag9zfnRyYWRlb3MtdGVzdDRyJgsSGWNvbW1lcmNlRG9jcy9RdW90ZU9yT2ZmZXIYgICAsJbu0QoM

The problem with the big white space before the tables I really appreciate your help.
I am using wkhtmltopdf release 0.12.2-dev-5dea253 on linux debian server 64bit, and on my local machine the same version but for windows-8 64bit

@faustow
Copy link

faustow commented Apr 2, 2015

hi @subhimarabeh , did you ever solve this? I've been having similar issues so your solution might apply to me as well? Thanks in advance!

@ashkulz
Copy link
Member

ashkulz commented Apr 5, 2015

@faustow: posting the minimal HTML/CSS inline would be help in investigating this further.

@faustow
Copy link

faustow commented Apr 6, 2015

The version of wkhtmltopdf I was using when answering to the bug report is v0.12.1 with patched qt. The problem is that it sometimes shows big whitespaces inside tables for apparently no reason. I have tried to detect this whitespace with js to try and remove it, but it doesn't seem to be there as far as javascript knows.

Now I've downloaded each version of wkhtmltopdf and compiled the same report against each of them so you can see the differences.
Short version is:

  • v0.13.0-alpha-4046a03 doesn't have headers on any page (probably because it lacks the patched qt) and the table contents were kind of messed up
  • v0.12.2.1 doesn't show the problem with the whitespace in the table but the page header is only shown in the first page
  • v0.12.2 doesn't show the problem with the whitespace in the table but the page header is only shown in the first page
  • v0.12.1 (the version I always use) is the one with the whitespace problem

The HTML used is the following:

<div id="client-non-compliant-player-list">
    <table>
        <th>THIS IS THE TITLE</th>
    </table>
    <br>
    <table id="clients">
        <tr data-before-template='data-before-template'>
            <th class="client-column">CLIENT</th>
            <th class="team-column-header">TEAM</th>
            <th class="id-column">PLAYER ID</th>
            <th class="description-column">DESCRIPTION</th>
            <th class="inspection-column">INSPECTION</th>
            <th class="schedule-column">SCHEDULE</th>
        </tr>
        <tr data-template='data-template'>
            <td class="client-column">{{name}}</td>
            <td colspan="5">
                <table class="no-border">
                    <tr data-template-for='teams'>
                        <td class="team-column no-border">{{team_name}}</td>
                        <td class="no-border">
                            <table class='player-table no-border' >
                                <tr data-template-for="players" >
                                    <td class="id-column no-border">{{player_name}}</td>
                                    <td class="description-column no-border">{{player_description}}</td>
                                    <td class="inspection-column no-border">{{player_inspection}}</td>
                                    <td class="schedule-column no-border">{{player_schedule}}</td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>

I have removed the css so this post isn't that long. The {{...}}-labels are for tempojs.

I guess if only I could make v0.12.2.1 have page headers in every page then this problem wouldn't need to be solved/ Do you have any ideas?

@ashkulz
Copy link
Member

ashkulz commented Apr 7, 2015

What do you mean by a page header? Do you mean "THIS IS A TITLE"? There is no support for repeating arbitrary HTML as a page header in WebKit. Closing this as your original issue seems to be solved with the latest version.

@faustow
Copy link

faustow commented Apr 7, 2015

No, I mean header like in --header-html. I've opened #2284 for this.

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

No branches or pull requests

3 participants