Add options in function pdf_pagefoot of pdf.lib.php - Revision 2
This commit is contained in:
parent
6c172b30f5
commit
ff342f79f2
@ -1181,6 +1181,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
$pdf->SetAutoPageBreak(1, 0); // Restore pagebreak
|
$pdf->SetAutoPageBreak(1, 0); // Restore pagebreak
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getDolGlobalInt('PDF_FREETEXT_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(0, 0); } // Option for disable auto pagebreak
|
||||||
if ($line) { // Free text
|
if ($line) { // Free text
|
||||||
$pdf->SetXY($dims['lm'], -$posy);
|
$pdf->SetXY($dims['lm'], -$posy);
|
||||||
if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { // by default
|
if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { // by default
|
||||||
@ -1190,6 +1191,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
}
|
}
|
||||||
$posy -= $freetextheight;
|
$posy -= $freetextheight;
|
||||||
}
|
}
|
||||||
|
if (getDolGlobalInt('PDF_FREETEXT_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(1, 0); } // Restore pagebreak
|
||||||
|
|
||||||
$pdf->SetY(-$posy);
|
$pdf->SetY(-$posy);
|
||||||
|
|
||||||
@ -1199,16 +1201,15 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Option for set top margin height of footer after freetext
|
// Option for set top margin height of footer after freetext
|
||||||
if (getDolGlobalString('PDF_FOOTER_TOP_MARGIN') || getDolGlobalString('PDF_FOOTER_TOP_MARGIN') === '0') {
|
if (getDolGlobalString('PDF_FOOTER_TOP_MARGIN') || getDolGlobalInt('PDF_FOOTER_TOP_MARGIN') === 0) {
|
||||||
// TODO Remove this case. Height should be good automatically, only $posy-- should be required.
|
$posy -= floatval(getDolGlobalString('PDF_FOOTER_TOP_MARGIN'));
|
||||||
$posy -= getDolGlobalInt('PDF_FOOTER_TOP_MARGIN');
|
|
||||||
} else {
|
} else {
|
||||||
$posy--;
|
$posy--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getDolGlobalString('PDF_FOOTER_DISABLE_PAGEBREAK') === '1') { $pdf->SetAutoPageBreak(0, 0); } // Option for disable auto pagebreak
|
if (getDolGlobalInt('PDF_FOOTER_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(0, 0); } // Option for disable auto pagebreak
|
||||||
$pdf->writeHTMLCell($pdf->page_largeur - $pdf->margin_left - $pdf->margin_right, $mycustomfooterheight, $dims['lm'], $dims['hk'] - $posy, dol_htmlentitiesbr($mycustomfooter, 1, 'UTF-8', 0));
|
$pdf->writeHTMLCell($pdf->page_largeur - $pdf->margin_left - $pdf->margin_right, $mycustomfooterheight, $dims['lm'], $dims['hk'] - $posy, dol_htmlentitiesbr($mycustomfooter, 1, 'UTF-8', 0));
|
||||||
if (getDolGlobalString('PDF_FOOTER_DISABLE_PAGEBREAK') === '1') { $pdf->SetAutoPageBreak(1, 0); } // Restore pagebreak
|
if (getDolGlobalInt('PDF_FOOTER_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(1, 0); } // Restore pagebreak
|
||||||
|
|
||||||
$posy -= $mycustomfooterheight - 3;
|
$posy -= $mycustomfooterheight - 3;
|
||||||
} else {
|
} else {
|
||||||
@ -1224,6 +1225,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
$pdf->SetAutoPageBreak(1, 0); // Restore pagebreak
|
$pdf->SetAutoPageBreak(1, 0); // Restore pagebreak
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getDolGlobalInt('PDF_FREETEXT_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(0, 0); } // Option for disable auto pagebreak
|
||||||
if ($line) { // Free text
|
if ($line) { // Free text
|
||||||
$pdf->SetXY($dims['lm'], -$posy);
|
$pdf->SetXY($dims['lm'], -$posy);
|
||||||
if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { // by default
|
if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { // by default
|
||||||
@ -1233,6 +1235,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
}
|
}
|
||||||
$posy -= $freetextheight;
|
$posy -= $freetextheight;
|
||||||
}
|
}
|
||||||
|
if (getDolGlobalInt('PDF_FREETEXT_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(1, 0); } // Restore pagebreak
|
||||||
|
|
||||||
$pdf->SetY(-$posy);
|
$pdf->SetY(-$posy);
|
||||||
|
|
||||||
@ -1242,9 +1245,8 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Option for set top margin height of footer after freetext
|
// Option for set top margin height of footer after freetext
|
||||||
if (getDolGlobalString('PDF_FOOTER_TOP_MARGIN') || getDolGlobalString('PDF_FOOTER_TOP_MARGIN') === '0') {
|
if (getDolGlobalString('PDF_FOOTER_TOP_MARGIN') || getDolGlobalInt('PDF_FOOTER_TOP_MARGIN') === 0) {
|
||||||
// TODO Remove this case. Height should be good automatically, only $posy-- should be required.
|
$posy -= floatval(getDolGlobalString('PDF_FOOTER_TOP_MARGIN'));
|
||||||
$posy -= getDolGlobalString('PDF_FOOTER_TOP_MARGIN');
|
|
||||||
} else {
|
} else {
|
||||||
$posy--;
|
$posy--;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user