Jump to content

[SOLVED] Invoice PDF initial view


Recommended Posts

Hi all,

By default, when you open a PDF invoice the selected view of the PDF seems to be "fill width". I know this setting can be changed at the PDF creation time. I'd like it to be set to "fit to screen" or "fit page", so you can see the whole invoice on your screen instead of those enormous letters and having to scroll or resize it to see all the invoice information.

Anyone knows which is the parameter and where to put the code?

Thans a lot!

Link to comment
Share on other sites

I have edited the file classes/PDF.php

About line 363, find this

       if (!$multiple)
           $pdf = new PDF('P', 'mm', 'A4');
       $pdf->SetAutoPageBreak(true, 35);
       $pdf->StartPageGroup();



and insert a new line, with the SetDisplayMode instruction:

       if (!$multiple)
           $pdf = new PDF('P', 'mm', 'A4');
       $pdf->SetDisplayMode(100);
       $pdf->SetAutoPageBreak(true, 35);
       $pdf->StartPageGroup();



In this case, I've set it to '100' because I want it to show the pdf at 100% when openened. Other option is use the fullpage parameter to fit all the doc in the screen. This is the syntax:

       $pdf->SetDisplayMode(fullpage);



More info and options at the FPDF page http://www.fpdf.org/en/doc/setdisplaymode.htm

Tip: the real parameter doesn't seem to work; that's why I've used 100 (%) instead

Link to comment
Share on other sites

×
×
  • Create New...