wkhtmltopdf headers missing on second page of PDF

(2 posts) (2 voices)
  1. cris, Member

    Hello,

    I'm pretty sure this is a wkhtmltopdf deficiency, but thought I would ask to see if there are any work-arounds or alternative solutions. I have a crosstab table with rotated headers using transform. It works great when the PDF is limited to one page. When the PDF spans multiple pages, the rotated headers are blank. If I remove the 'display:block' from the CSS below, the headers aren't rotated but they print on each page. I would like the rotated headers to be displayed on each page of the PDF.

    Any ideas for a work-around? I see there is a way to run additional javascript through wkhtmltopdf after the page is done loading: --run-script js Run this additional javascript after the page is done loading (repeatable). Is this a potential solution?

    Thanks,
    Cris

    The code is long, but mostly repeating to demonstrate the failure of the PDF header creation on the second page.


    BEGIN SELECT 'dbr.css', ' th span {
    margin-bottom: 10px;
    padding: 0 .5em; -webkit-transform:rotate(-90deg);
    -moz-transform:rotate(-90deg);
    display:block;
    }
    '; select 'dbr.crosstab', 'xtab'; select 'abc' AS 'leftcol', CONCAT('dbr.html:<span>','first', '</span>') as 'xtab', 25 as 'nums'
    union all
    select 'def',CONCAT('dbr.html:<span>','second', '</span>'), 25
    union all
    select 'ghi',CONCAT('dbr.html:<span>','second', '</span>'), 26
    union all
    select 'jkl',CONCAT('dbr.html:<span>','third', '</span>'), 88
    union all
    select 'mno', CONCAT('dbr.html:<span>','first', '</span>'), 37
    union all
    select 'eds', CONCAT('dbr.html:<span>','third', '</span>'), 33
    union all
    select 'egh', CONCAT('dbr.html:<span>','second', '</span>'), 73
    union all
    select 'kej', CONCAT('dbr.html:<span>','first', '</span>'), 9
    union all
    select 'ieo', CONCAT('dbr.html:<span>','third', '</span>'), 82
    union all
    select 'kje1', CONCAT('dbr.html:<span>','second', '</span>'), 23
    union all
    select 'mno2', CONCAT('dbr.html:<span>','first', '</span>'), 53
    union all
    select 'eus3', CONCAT('dbr.html:<span>','third', '</span>'), 9
    union all
    select 'asd4', CONCAT('dbr.html:<span>','second', '</span>'), 37
    union all
    select 'def5',CONCAT('dbr.html:<span>','second', '</span>'), 25
    union all
    select 'ghi6',CONCAT('dbr.html:<span>','second', '</span>'), 26
    union all
    select 'jkl7',CONCAT('dbr.html:<span>','third', '</span>'), 88
    union all
    select 'mno8', CONCAT('dbr.html:<span>','first', '</span>'), 37
    union all
    select 'eds9', CONCAT('dbr.html:<span>','third', '</span>'), 33
    union all
    select 'egh9', CONCAT('dbr.html:<span>','second', '</span>'), 73
    union all
    select 'kej8', CONCAT('dbr.html:<span>','first', '</span>'), 9
    union all
    select 'ieo7', CONCAT('dbr.html:<span>','third', '</span>'), 82
    union all
    select 'kje6', CONCAT('dbr.html:<span>','second', '</span>'), 23
    union all
    select 'mno5', CONCAT('dbr.html:<span>','first', '</span>'), 53
    union all
    select 'ers4', CONCAT('dbr.html:<span>','third', '</span>'), 9
    union all
    select 'afd3', CONCAT('dbr.html:<span>','second', '</span>'), 37
    union all
    select 'def2',CONCAT('dbr.html:<span>','second', '</span>'), 25
    union all
    select 'ghi1',CONCAT('dbr.html:<span>','second', '</span>'), 26
    union all
    select 'jkld',CONCAT('dbr.html:<span>','third', '</span>'), 88
    union all
    select 'mnos', CONCAT('dbr.html:<span>','first', '</span>'), 37
    union all
    select 'edsw', CONCAT('dbr.html:<span>','third', '</span>'), 33
    union all
    select 'eghe', CONCAT('dbr.html:<span>','second', '</span>'), 73
    union all
    select 'keju', CONCAT('dbr.html:<span>','first', '</span>'), 9
    union all
    select 'ieot', CONCAT('dbr.html:<span>','third', '</span>'), 82
    union all
    select 'kjed', CONCAT('dbr.html:<span>','second', '</span>'), 23
    union all
    select 'mnol', CONCAT('dbr.html:<span>','first', '</span>'), 53
    union all
    select 'euse', CONCAT('dbr.html:<span>','third', '</span>'), 9
    union all
    select 'asde', CONCAT('dbr.html:<span>','second', '</span>'), 37
    union all
    select 'defq',CONCAT('dbr.html:<span>','second', '</span>'), 25
    union all
    select 'ghia',CONCAT('dbr.html:<span>','second', '</span>'), 26
    union all
    select 'jklj',CONCAT('dbr.html:<span>','third', '</span>'), 88
    union all
    select 'mnod', CONCAT('dbr.html:<span>','first', '</span>'), 37
    union all
    select 'edss', CONCAT('dbr.html:<span>','third', '</span>'), 33
    union all
    select 'egh9', CONCAT('dbr.html:<span>','second', '</span>'), 73
    union all
    select 'kej3', CONCAT('dbr.html:<span>','first', '</span>'), 9
    union all
    select 'ieo1', CONCAT('dbr.html:<span>','third', '</span>'), 82
    union all
    select 'kje2', CONCAT('dbr.html:<span>','second', '</span>'), 23
    union all
    select 'mno5', CONCAT('dbr.html:<span>','first', '</span>'), 53
    union all
    select 'eus6', CONCAT('dbr.html:<span>','third', '</span>'), 9
    union all
    select 'asd7', CONCAT('dbr.html:<span>','second', '</span>'), 37
    union all
    select 'defr',CONCAT('dbr.html:<span>','second', '</span>'), 25
    union all
    select 'ghiy',CONCAT('dbr.html:<span>','second', '</span>'), 26
    union all
    select 'jkl5',CONCAT('dbr.html:<span>','third', '</span>'), 88
    union all
    select 'mno8', CONCAT('dbr.html:<span>','first', '</span>'), 37
    union all
    select 'eds8', CONCAT('dbr.html:<span>','third', '</span>'), 33
    union all
    select 'egh9', CONCAT('dbr.html:<span>','second', '</span>'), 73
    union all
    select 'keji', CONCAT('dbr.html:<span>','first', '</span>'), 9
    union all
    select 'ieoo', CONCAT('dbr.html:<span>','third', '</span>'), 82
    union all
    select 'kjey', CONCAT('dbr.html:<span>','second', '</span>'), 23
    union all
    select 'mnor', CONCAT('dbr.html:<span>','first', '</span>'), 53
    union all
    select 'eu5s', CONCAT('dbr.html:<span>','third', '</span>'), 9
    union all
    select 'as3d', CONCAT('dbr.html:<span>','second', '</span>'), 37
    union all
    select '2def',CONCAT('dbr.html:<span>','second', '</span>'), 25
    union all
    select 'g2hi',CONCAT('dbr.html:<span>','second', '</span>'), 26
    union all
    select 'jk1l',CONCAT('dbr.html:<span>','third', '</span>'), 88
    union all
    select 'mn6o', CONCAT('dbr.html:<span>','first', '</span>'), 37
    union all
    select 'ed7s', CONCAT('dbr.html:<span>','third', '</span>'), 33
    union all
    select 'e4h', CONCAT('dbr.html:<span>','second', '</span>'), 73
    union all
    select 'k5ej', CONCAT('dbr.html:<span>','first', '</span>'), 9
    union all
    select 'i7eo', CONCAT('dbr.html:<span>','third', '</span>'), 82
    union all
    select 'k4je', CONCAT('dbr.html:<span>','second', '</span>'), 23
    union all
    select 'm3no', CONCAT('dbr.html:<span>','first', '</span>'), 53
    union all
    select 'e3us', CONCAT('dbr.html:<span>','third', '</span>'), 9
    union all
    select 'as8d', CONCAT('dbr.html:<span>','second', '</span>'), 37; END
    $$

  2. myDBR Team, Key Master

    Cris,
    this is/was a bug in wkhtmltopdf.

    You could try the Bleeding Edge version, compile the wkhtmltopd from source or just wait for the next release.

    The --run-script allows one to add additional JS to a page, but as you can already do this inside myDBR, the option is not needed.

    --
    myDBR Team


Reply

You must log in to post.