Skip to content

Commit

Permalink
Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Apr 27, 2024
2 parents 73a07ed + fdc1cdd commit 4ed7702
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions htdocs/core/lib/pdf.lib.php
Expand Up @@ -1303,17 +1303,15 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
}
}
}
// Show page nb only on iso languages (so default Helvetica font)
$pdf->SetXY($dims['wk'] - $dims['rm'] - 18 - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_X', 0), -$posy - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_Y', 0));

if (getDolGlobalString('PDF_USE_GETALIASNBPAGE_FOR_TOTAL')) {
// $pagination = $pdf->getAliasNumPage().' / '.$pdf->getAliasNbPages(); // works with $pdf->Cell
$pagination = $pdf->PageNo().' / '.$pdf->getAliasNbPages(); // seems to not works with all fonts like ru_UK
} else {
$pagination = $pdf->PageNo().' / '.$pdf->getNumPages(); // seems to always work even with $pdf->Cell. But some users has reported wrong nb (no way to reproduce)
// Show page nb and apply correction for some font.
$pdf->SetXY($dims['wk'] - $dims['rm'] - 18 - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_X', 0), -$posy - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_Y', 0));
$pagination = $pdf->PageNo().' / '.$pdf->getAliasNbPages();
$fontRenderCorrection = 0;
if (in_array(pdf_getPDFFont($outputlangs), array('freemono', 'DejaVuSans'))) {
$fontRenderCorrection = 10;
}

$pdf->MultiCell(18, 2, $pagination, 0, 'R', 0);
$pdf->MultiCell(18 + $fontRenderCorrection, 2, $pagination, 0, 'R', 0);

// Show Draft Watermark
if (!empty($watermark)) {
Expand Down

0 comments on commit 4ed7702

Please sign in to comment.