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?
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');
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.
En poursuivant votre navigation, vous acceptez le dépôt de cookies tiers destinés au bon fonctionnement et à la sécurisation du site (gestion de session, reCaptcha) et à une analyse statistique anonymisée des accès sur notre site (Google Analytics). Si vous vous inscrivez, les informations que vous fournirez ne seront jamais divulguées à un tiers sous quelque forme que ce soit. En savoir plus
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.