@@ -148,9 +174,12 @@ class pdf_typhon extends ModelePDFDeliveryOrder
...
@@ -148,9 +174,12 @@ class pdf_typhon extends ModelePDFDeliveryOrder
if(file_exists($dir))
if(file_exists($dir))
{
{
$pdf=pdf_getInstance($this->format);
$nblines=count($object->lines);
// Create pdf instance
$pdf=pdf_getInstance($this->format);
$default_font_size=pdf_getPDFFontSize($outputlangs);// Must be after pdf_getInstance
$default_font_size=pdf_getPDFFontSize($outputlangs);// Must be after pdf_getInstance
$heightforinfotot=50;// Height reserved to output the info and total part
$heightforinfotot=30;// Height reserved to output the info and total part
$heightforfreetext=(isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5);// Height reserved to output the free text on last page
$heightforfreetext=(isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5);// Height reserved to output the free text on last page
$heightforfooter=$this->marge_basse+8;// Height reserved to output the footer (value include bottom margin)
$heightforfooter=$this->marge_basse+8;// Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
$pdf->SetAutoPageBreak(1,0);
...
@@ -195,7 +224,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
...
@@ -195,7 +224,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
/*
/*
// Positionne $this->atleastonediscount si on a au moins une remise
// Positionne $this->atleastonediscount si on a au moins une remise
for ($i = 0 ; $i < $nblignes ; $i++)
for ($i = 0 ; $i < $nblines ; $i++)
{
{
if ($object->lines[$i]->remise_percent)
if ($object->lines[$i]->remise_percent)
{
{
...
@@ -214,7 +243,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
...
@@ -214,7 +243,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
@@ -252,13 +281,46 @@ class pdf_typhon extends ModelePDFDeliveryOrder
...
@@ -252,13 +281,46 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$pdf->SetTextColor(0,0,0);
$pdf->SetTextColor(0,0,0);
$pdf->setTopMargin($tab_top_newpage);
$pdf->setTopMargin($tab_top_newpage);
$pdf->setPageOrientation('',1,$heightforfooter+$heightforfreetext);// The only function to edit the bottom margin of current page to set it.
$pdf->setPageOrientation('',1,$heightforfooter+$heightforfreetext+$heightforinfotot);// The only function to edit the bottom margin of current page to set it.
$reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action);// Note that $action and $object may have been modified by some hooks
if(!empty($conf->global->MAIN_UMASK))
if(!empty($conf->global->MAIN_UMASK))
@chmod($file,octdec($conf->global->MAIN_UMASK));
@chmod($file,octdec($conf->global->MAIN_UMASK));
return1;
return1;// pas d'erreur
}
}
else
else
{
{
...
@@ -449,66 +526,90 @@ class pdf_typhon extends ModelePDFDeliveryOrder
...
@@ -449,66 +526,90 @@ class pdf_typhon extends ModelePDFDeliveryOrder
return0;
return0;
}
}
/**
* Show miscellaneous information (payment mode, payment term, ...)
$this->printRect($pdf,$this->marge_gauche,$tab_top,$this->page_largeur-$this->marge_gauche-$this->marge_droite,$tab_height,$hidetop,$hidebottom);// Rect prend une longueur en 3eme param et 4eme param