Merge pull request #23761 from habot-it/pdf.lib.php
Add options in function pdf_pagefoot & pdf_pagehead of pdf.lib.php
This commit is contained in:
commit
ca57a3ef90
@ -725,11 +725,16 @@ function pdf_pagehead(&$pdf, $outputlangs, $page_height)
|
|||||||
$filepath = $conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_USE_BACKGROUND_ON_PDF;
|
$filepath = $conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_USE_BACKGROUND_ON_PDF;
|
||||||
if (file_exists($filepath)) {
|
if (file_exists($filepath)) {
|
||||||
$pdf->SetAutoPageBreak(0, 0); // Disable auto pagebreak before adding image
|
$pdf->SetAutoPageBreak(0, 0); // Disable auto pagebreak before adding image
|
||||||
|
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);
|
$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->SetPageMark(); // This option avoid to have the images missing on some pages
|
||||||
$pdf->SetAutoPageBreak(1, 0); // Restore pagebreak
|
$pdf->SetAutoPageBreak(1, 0); // Restore pagebreak
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND') && getDolGlobalString('MAIN_ADD_PDF_BACKGROUND') != '-1') {
|
||||||
|
$pdf->SetPageMark(); // This option avoid to have the images missing on some pages
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1247,6 +1252,8 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
|
|
||||||
$pdf->SetY(-$posy);
|
$pdf->SetY(-$posy);
|
||||||
|
|
||||||
|
// Option for hide all footer (page number will no hidden)
|
||||||
|
if (!getDolGlobalInt('PDF_FOOTER_HIDDEN')) {
|
||||||
// Hide footer line if footer background color is set
|
// Hide footer line if footer background color is set
|
||||||
if (!getDolGlobalString('PDF_FOOTER_BACKGROUND_COLOR')) {
|
if (!getDolGlobalString('PDF_FOOTER_BACKGROUND_COLOR')) {
|
||||||
$pdf->line($dims['lm'], $dims['hk'] - $posy, $dims['wk'] - $dims['rm'], $dims['hk'] - $posy);
|
$pdf->line($dims['lm'], $dims['hk'] - $posy, $dims['wk'] - $dims['rm'], $dims['hk'] - $posy);
|
||||||
@ -1287,9 +1294,10 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Show page nb only on iso languages (so default Helvetica font)
|
// Show page nb only on iso languages (so default Helvetica font)
|
||||||
// if (strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica') {
|
// if (strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica') {
|
||||||
$pdf->SetXY($dims['wk'] - $dims['rm'] - 18, -$posy);
|
$pdf->SetXY($dims['wk'] - $dims['rm'] - 18 - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_X', 0), -$posy - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_Y', 0));
|
||||||
// $pdf->MultiCell(18, 2, $pdf->getPageNumGroupAlias().' / '.$pdf->getPageGroupAlias(), 0, 'R', 0);
|
// $pdf->MultiCell(18, 2, $pdf->getPageNumGroupAlias().' / '.$pdf->getPageGroupAlias(), 0, 'R', 0);
|
||||||
// $pdf->MultiCell(18, 2, $pdf->PageNo().' / '.$pdf->getAliasNbPages(), 0, 'R', 0); // doesn't works with all fonts
|
// $pdf->MultiCell(18, 2, $pdf->PageNo().' / '.$pdf->getAliasNbPages(), 0, 'R', 0); // doesn't works with all fonts
|
||||||
// $pagination = $pdf->getAliasNumPage().' / '.$pdf->getAliasNbPages(); // works with $pdf->Cell
|
// $pagination = $pdf->getAliasNumPage().' / '.$pdf->getAliasNbPages(); // works with $pdf->Cell
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user