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

Prochaines Sessions

Les prochaines formations et démonstrations sont ouvertes, inscrivez-vous rapidement !

 

Démonstration de ProjeQtOr

(gratuit, sur inscription)
 

13 mai 2025 (10h30-12h)

5 juin 2025 (16h-17h30)

 
 

Planifiez avec ProjeQtOr

14 et 15 mai 2025 (9h-12h30)

18 et 19 juin 2025 (9h-12h30)

 
 

Administrez avec ProjeQtOr

20 et 21 mai (9h-12h30)

25 et 26 juin (9h-12h30)

 

 

 

Export a bill in PDF but in portrait

More
01 Déc 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 Connexion or Create an account to join the conversation.

More
01 Déc 2013 16:09 - 01 Déc 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 Déc 2013 16:09 by babynus.

Please Connexion or Create an account to join the conversation.

More
01 Déc 2013 22:20 - 01 Déc 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 Déc 2013 22:23 by jphuart.

Please Connexion or Create an account to join the conversation.

More
03 Déc 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 Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.033 seconds

Paramétrages de cookies

×

Cookies fonctionnels

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

Veuillez vous connecter pour voir vos activités!

Autres cookies

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