TCPDF problem with semi transparent regions of pngs

41 Views Asked by At

I have got a problem with semi transparent regions of pngs in rendered pdfs by tcpdf. It seems like these regions get cut out. I suppose it is something related that it is treated like a 8-bit png? But i can't figure it out.

On the website itself the pngs are rendered as they should.

Here is my code:

class MYPDF extends TCPDF {
 //Page header
 public function Header() {
  // get the current page break margin
  $bMargin = $this->getBreakMargin();
  // get current auto-page-break mode
  $auto_page_break = $this->AutoPageBreak;
  // disable auto-page-break
  $this->SetAutoPageBreak(false, 0);
  // set bacground color
  $this->Rect(0, 0, $this->getPageWidth(), $this->getPageHeight(), "DF", "",   array(0,25,41));         
  // restore auto-page-break status
  $this->SetAutoPageBreak($auto_page_break, $bMargin);
  // set the starting point for the page content
  $this->setPageMark();
 }
}


$pdf = new MYPDF("P", "mm", "A4", true, 'UTF-8', false);
$pdf->AddPage();

$pdf->Image("test/neon_circle.png", 50, 50, 100, '', '', '', '', false, 300);

$pdf->Output("print.pdf", "I");

That's the png That is how it should look like

Thats the link to the pdf

0

There are 0 best solutions below