2
0
forked from Wavyzz/dolibarr

Try to keep proportions of logo

This commit is contained in:
Laurent Destailleur
2019-06-13 10:08:35 +02:00
committed by GitHub
parent 3f63be6045
commit 2bc821d900

View File

@@ -179,7 +179,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
$logoWidth = $widthtouse/2;
if (($textleft == '%LOGO%' || $textleft == '%PHOTO%' || $textleft == '%BARCODE%') && !strstr($textright, '%') ) // left part logo/barcode right part text
{
if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+$xleft, $_PosY+$ytop, $logoWidth, $logoHeight);
if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+$xleft, $_PosY+$ytop, $logoWidth, 0);
elseif ($code && !empty($encoding))
{
$this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+$xleft, $_PosY+$ytop, $widthtouse/2, $heighttouse);
@@ -189,7 +189,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
}
elseif (($textright == '%LOGO%' || $textright == '%PHOTO%' || $textright == '%BARCODE%') && !strstr($textleft, '%')) // right part logo/barcode left part text
{
if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+($widthtouse/2), $_PosY+$ytop, $logoWidth, $logoHeight);
if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+($widthtouse/2), $_PosY+$ytop, $logoWidth, 0);
elseif ($code && !empty($encoding))
{
$this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+($widthtouse/2), $_PosY+$ytop, $widthtouse/2, $heighttouse);