FPDF error: This document (docuement.pdf) probably uses a compression technique which is not supported by the free parser shipped with FPDI.

If you ever encounter this error “FPDF error: This document (docuement.pdf) probably uses a compression technique which is not supported by the free parser shipped with FPDI.”, this is a version problem, FPDF library supports only PDF version 1.4 and previous.

So, what can you do ? change PDF version with ghostscript.

Download it here http://www.ghostscript.com/download/gsdnld.html

run to change :

 ./gs-919-linux_x86_64 -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=file.pdf newfile.pdf 

fpdf € transform into ? with UTF-8

You try to write a € character on your pdf doc but it is transformed into a “?”.
You can replace it by the chr(128) sign.

$this->MultiCell(170, $this->hh, $price." ".chr(128), 0, 'L', false);

When the sign is inside a string, you can use this

$contenu = str_replace('€', chr(128), $contenu);
$this->MultiCell(170, $this->hh, $contenu, 0, 'L', false);

But you have special characters too, you need to encode string into UTF-8

$contenu = str_replace('€', chr(128), $contenu);
$this->MultiCell(170, $this->hh, utf8_decode($contenu), 0, 'L', false);

This works well for “é” or “ç” but not for “€”.
The ultimate solution is :

$contenu = str_replace('€', utf8_encode(chr(128)), $contenu);
$this->MultiCell(170, $this->hh, utf8_decode($contenu), 0, 'L', false);