Hello,
When I use "SetProtection()" and UTF-8, all "&" characters are replaced with a "A" with an accent.
Here is an example:
$html2pdf = new HTML2PDF('P','A4', 'en', false, 'UTF-8');
$html2pdf->writeHTML($content);
$html2pdf->pdf->SetProtection(array("print", "copy"), "", "my_passwd");
$html2pdf->Output("exemple01.pdf", "F");
Using ISO-8859-15 instead, or not using SetProtection doesn't produced this error.
The text that i want to display is a simple " " or "&".
Thank you in advance.
maybe try an utf8_decode on the string given to setprotection ?
et la le mec il le pécho par le bras et il lui dit '
Spipu Le 01/04/2011 à 10:18 have you try directly with TCPDF ? because setProtection is a nativ method of TCPDF. Maybe ther is a bug in it.
Hello,
Thank you for your replies.
I tried with "utf8_encode()" to transform ISO-8859-15 to UTF-8 and "utf8_decode()" to transform UTF-8 to ISO-8859-15, but I still got the same error.
I then directly call the TCPDF encryption method:
echo "[" . $this->_RC4($this->_objectkey($this->n), "&") . "]";
But the encoded string result is the same for both encodings, so I think it's not a bug in TCPDF but surely in html2pdf.
Can you please provide me a solution or a workaround?
Thank you in advance.