Width of report on PDF export

(9 posts) (2 voices)

Tags:

No tags yet.

  1. phil1308, Blocked

    Hello again,
    still some formating questions while exporting my report to PDF.
    The width of the report doesn't fit the width of the PDF page.

    See for exemple the begining of my report : the title must fit all page width.
    It's ok while in html :

    But not when exported :

    Do you know why ?

  2. myDBR Team, Key Master

    Have you installed wkhtmltopdf?

    --
    myDBR Team

  3. phil1308, Blocked

    Yes, it is installed and work well I think...

  4. phil1308, Blocked

    So, what do you think ?
    Is it an wkhtmltopdf bug ?

  5. myDBR Team, Key Master

    How does your title definition look like? wkhtmltopdf is quite capable on page rendering as it is based on the WebKit.

    --
    myDBR Team

  6. phil1308, Blocked

    Here is the code :
    select 'dbr.text', concat('Consultations IMADIS du ', DATE_FORMAT(pStartDate,'%d/%m/%Y') , ' au ', DATE_FORMAT(pEndDate ,'%d/%m/%Y')), 'clTitle';
    select 'dbr.text', pEtablissement, 'clSubtitle' ;

    and the associated css :
    .clTitle
    {
    color:#365f91;background-color: #dbe5f1;font-family: Times New Roman, Times, serif; font-size: 2em; padding: 0.2em; margin: 0;text-align: center;
    border-top: 1px solid #000055; border-left: 5px solid #000055; border-right: 5px solid #000055;
    }
    .clSubtitle
    {
    color:#365f91;background-color: #dbe5f1;font-family: Times New Roman, Times, serif; font-size: 2em; font-weight: bold; padding: 0.2em; margin: 0;text-align: center;
    border-bottom: 1px solid #000055; border-left: 5px solid #000055; border-right: 5px solid #000055;
    }

    I've also tried a simplest code (instead of the previous one ) :
    select 'dbr.purehtml', '<table width="100%" border="1"><tr><td>';
    select 'dbr.purehtml', concat('Consultations IMADIS du ', DATE_FORMAT(pStartDate,'%d/%m/%Y') , ' au ', DATE_FORMAT(pEndDate ,'%d/%m/%Y'));
    select 'dbr.purehtml', '</td></tr></table>';
    Same result...

  7. myDBR Team, Key Master

    You can use the debug option in export to have the standalone HTML file so you can try the wkhtmltopdf from command line what is causing this. CSS definition itself looks ok.

    --
    myDBR Team

  8. phil1308, Blocked

    The original html file looks ok :

    So I tried all combination of wkhtmltopdf command line :
    - the original one :
    C:\"Program Files (x86)"\wkhtmltopdf\wkhtmltopdf -q --header-html http://127.0.0.1/myDBR/user/export_header_pdf.php --margin-top 13 C:\Users\Philippe\AppData\Local\Temp\1286921387.html t.pdf

    - other with less options :
    C:\"Program Files (x86)"\wkhtmltopdf\wkhtmltopdf --header-html http://127.0.0.1/myDBR/user/export_header_pdf.php --margin-top 13 C:\Users\Philippe\AppData\Local\Temp\1286921387.html t2.pdf

    C:\"Program Files (x86)"\wkhtmltopdf\wkhtmltopdf --margin-top 13 C:\Users\Philippe\AppData\Local\Temp\1286921387.html t3.pdf

    C:\"Program Files (x86)"\wkhtmltopdf\wkhtmltopdf --header-html http://127.0.0.1/myDBR/user/export_header_pdf.php C:\Users\Philippe\AppData\Local\Temp\1286921387.html t4.pdf

    C:\"Program Files (x86)"\wkhtmltopdf\wkhtmltopdf C:\Users\Philippe\AppData\Local\Temp\1286921387.html t5.pdf

    All does the same : there is a margin on the right side of the pdf page.
    Here is the result of the last command (with no option at all) :

  9. myDBR Team, Key Master

    Might be that your page size or page right margin is causing the trouble. Try to adjust the wkhtmltopdf parameters.

    --
    myDBR Team


Reply

You must log in to post.