diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index 1d238ed231d..3bba7dcdf89 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -319,14 +319,16 @@ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent)
{
for ($page=$start_page; $page <= $end_page; ++$page) {
$pdf->setPage($page);
+ $tmpm=$pdf->getMargins();
+ $tMargin = $tmpm['top'];
if ($page == $start_page) {
// first page
- $height = $pdf->h - $start_y - $pdf->bMargin;
+ $height = $pdf->getPageHeight() - $start_y - $pdf->getBreakMargin();
} elseif ($page == $end_page) {
// last page
- $height = $end_y - $pdf->tMargin;
+ $height = $end_y - $tMargin;
} else {
- $height = $pdf->h - $pdf->tMargin - $pdf->bMargin;
+ $height = $pdf->getPageHeight() - $tMargin - $pdf->getBreakMargin();
}
}
}
@@ -949,7 +951,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
if ($line) // Free text
{
//$line="eee
\nfdsfsdf
\nghfghg
";
- if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) // by default
+ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
$width=20000; $align='L'; // By default, ask a manual break: We use a large value 20000, to not have automatic wrap. This make user understand, he need to add CR on its text.
if (! empty($conf->global->MAIN_USE_AUTOWRAP_ON_FREETEXT)) {