View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Export a bill in PDF but in portrait - ProjeQtOr
 
 

Export a bill in PDF but in portrait

More
01 Dec 2013 15:11 #1 by jphuart
Hello,

I've created a new bill template that works fine.
It is correctly displayed in the report screen , but when I want to export it to PDF format it is always exported in landscape mode.
I found in the /view/print.php file, function finalizePrint() at line 154

$html2pdf = new HTML2PDF('L','A4','en');

Modifying 'L' in 'P' will export all my pdf in portrait mode.
But the pdf is cutting part of my report, so I suppose that I have to provide additional information (max width of my table report for example) somewhere.
In addition I would like to use the portrait mode for my new bill, but not for other PDF exports, so is it possible to define it somewhere?

I will be grateful for any idea about it.
Thanks

Jean Pierre

Please Log in or Create an account to join the conversation.

More
01 Dec 2013 16:09 - 01 Dec 2013 16:09 #2 by babynus

But the pdf is cutting part of my report, so I suppose that I have to provide additional information (max width of my table report for example) somewhere.

It is probably linked to the size oy your tables or divs.
If you set size in px or mm or eml, it may be larger than page size
If you set size it %, it should auto adjust to page size.

I would like to use the portrait mode for my new bill, but not for other PDF exports, so is it possible to define it somewhere?

No, you'll have to have code it, something like :
if (myReport) $html2pdf = new HTML2PDF('P','A4','en'); else $html2pdf = new HTML2PDF('L','A4','en');

Babynus
Administrator of ProjeQtOr web site
Last edit: 01 Dec 2013 16:09 by babynus.

Please Log in or Create an account to join the conversation.

More
01 Dec 2013 22:20 - 01 Dec 2013 22:23 #3 by jphuart
Here it is what I've done in the print.php file.

/* JPH added */
// $html2pdf = new HTML2PDF('L','A4','en');
$myReport = $_REQUEST 'reportFile' ;
if ($myReport == 'bill-jph.php') {
$html2pdf = new HTML2PDF ( 'P', 'A4', 'en', true, 'UTF-8', array(5, 18, 5, 10) );
} else {
$html2pdf = new HTML2PDF ( 'L', 'A4', 'en' );
}
/* end JPH */

And it works as I want.
But this is not the best way of doing it, on the next upgrade I will have to remodify the file.
For the bill, I've created a new file and modified into the database the call for the bill to my new file, so upgrading will remain easy.
I don't know well enough ProjeQtor to make a suggestion on how to allow customisations to remain compatible with core upgrades, but I would have found better if I could store the HTML2PDF arguments within the report file.

Thank you very much, anyway.
Ciao
Jean Pierre
Last edit: 01 Dec 2013 22:23 by jphuart.

Please Log in or Create an account to join the conversation.

More
03 Dec 2013 00:33 #4 by babynus

I don't know well enough ProjeQtor to make a suggestion on how to allow customisations to remain compatible with core upgrades

Yes, IT is a real constraint.
Not sure there is an easy clean solution.
Any suggestion is welcome.

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.035 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.