Skip to content
Snippets Groups Projects
Commit 74a9bbbf authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

FIX private property can't be read when building pdf

parent 80ac99e9
Branches
No related tags found
No related merge requests found
...@@ -319,14 +319,16 @@ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent) ...@@ -319,14 +319,16 @@ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent)
{ {
for ($page=$start_page; $page <= $end_page; ++$page) { for ($page=$start_page; $page <= $end_page; ++$page) {
$pdf->setPage($page); $pdf->setPage($page);
$tmpm=$pdf->getMargins();
$tMargin = $tmpm['top'];
if ($page == $start_page) { if ($page == $start_page) {
// first page // first page
$height = $pdf->h - $start_y - $pdf->bMargin; $height = $pdf->getPageHeight() - $start_y - $pdf->getBreakMargin();
} elseif ($page == $end_page) { } elseif ($page == $end_page) {
// last page // last page
$height = $end_y - $pdf->tMargin; $height = $end_y - $tMargin;
} else { } 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 ...@@ -949,7 +951,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
if ($line) // Free text if ($line) // Free text
{ {
//$line="eee<br>\nfd<strong>sf</strong>sdf<br>\nghfghg<br>"; //$line="eee<br>\nfd<strong>sf</strong>sdf<br>\nghfghg<br>";
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. $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)) { if (! empty($conf->global->MAIN_USE_AUTOWRAP_ON_FREETEXT)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment