From 329d8d01a67bf6e24da0c252221202c33d38388f Mon Sep 17 00:00:00 2001 From: habot-it <58470575+habot-it@users.noreply.github.com> Date: Sat, 11 Feb 2023 14:30:58 +0100 Subject: [PATCH] Add options in function pdf_pagefoot & pdf_pagehead of pdf.lib.php - Revision 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- htdocs/core/lib/pdf.lib.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index cf22b70f772..3da0dd889d6 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -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);