Add options in function pdf_pagefoot & pdf_pagehead of pdf.lib.php - Revision 1

Hello @eldy,

In pdf_pagehead function :

    Add MAIN_USE_BACKGROUND_ON_PDF_ALPHA option for change opacity of the background
     ̶S̶e̶t̶P̶a̶g̶e̶M̶a̶r̶k̶ ̶m̶o̶v̶e̶d̶ ̶t̶o̶ ̶f̶i̶x̶e̶ ̶t̶h̶e̶ ̶s̶a̶m̶e̶ ̶p̶r̶o̶b̶l̶e̶m̶ ̶o̶f̶ ̶M̶A̶I̶N̶_̶U̶S̶E̶_̶B̶A̶C̶K̶G̶R̶O̶U̶N̶D̶_̶O̶N̶_̶P̶D̶F̶ ̶b̶u̶t̶ ̶f̶o̶r̶ ̶M̶A̶I̶N̶_̶A̶D̶D̶_̶P̶D̶F̶_̶B̶A̶C̶K̶G̶R̶O̶U̶N̶D̶ ̶t̶o̶o̶

In pdf_pagefoot function :

    Add PDF_FOOTER_HIDDEN to hide all footer (page number will no hidden)
    Add PDF_FOOTER_PAGE_NUMBER_X & PDF_FOOTER_PAGE_NUMBER_Y to change XY position of the page number

Best regards,
Alban
This commit is contained in:
habot-it 2023-02-11 14:30:58 +01:00 committed by GitHub
parent bce25eaff1
commit 329d8d01a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -727,10 +727,10 @@ function pdf_pagehead(&$pdf, $outputlangs, $page_height)
if (getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF_ALPHA')) { $pdf->SetAlpha($conf->global->MAIN_USE_BACKGROUND_ON_PDF_ALPHA); } // Option for change opacity of background
$pdf->Image($filepath, (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_X) ? $conf->global->MAIN_USE_BACKGROUND_ON_PDF_X : 0), (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y) ? $conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y : 0), 0, $page_height);
if (getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF_ALPHA')) { $pdf->SetAlpha(1); }
$pdf->SetPageMark(); // This option avoid to have the images missing on some pages
$pdf->SetAutoPageBreak(1, 0); // Restore pagebreak
}
}
$pdf->SetPageMark(); // This option avoid to have the images missing on some pages
}
@ -1250,7 +1250,6 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
// Option for hide all footer (page number will no hidden)
if (getDolGlobalInt('PDF_FOOTER_HIDDEN') !== 1) {
// Hide footer line if footer background color is set
if (!getDolGlobalString('PDF_FOOTER_BACKGROUND_COLOR')) {
$pdf->line($dims['lm'], $dims['hk'] - $posy, $dims['wk'] - $dims['rm'], $dims['hk'] - $posy);