Skip to content

Commit

Permalink
NEW Add option PDF_DISABLE_MYCOMPANY_LOGO to disable logo on PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Oct 22, 2018
1 parent 2816bdf commit f65df9e
Show file tree
Hide file tree
Showing 6 changed files with 390 additions and 372 deletions.
31 changes: 17 additions & 14 deletions htdocs/core/modules/commande/doc/pdf_einstein.modules.php
Expand Up @@ -1261,27 +1261,30 @@ function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey="PdfOrd
$pdf->SetXY($this->marge_gauche,$posy);

// Logo
$logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
if ($this->emetteur->logo)
if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO))
{
if (is_readable($logo))
$logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
if ($this->emetteur->logo)
{
$height=pdf_getHeightForLogo($logo);
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
if (is_readable($logo))
{
$height=pdf_getHeightForLogo($logo);
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
}
else
{
$pdf->SetTextColor(200,0,0);
$pdf->SetFont('','B', $default_font_size -2);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
}
}
else
{
$pdf->SetTextColor(200,0,0);
$pdf->SetFont('','B', $default_font_size -2);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
$text=$this->emetteur->name;
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
}
}
else
{
$text=$this->emetteur->name;
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
}

$pdf->SetFont('','B', $default_font_size + 3);
$pdf->SetXY($posx,$posy);
Expand Down

0 comments on commit f65df9e

Please sign in to comment.