I attached two files:
- test_encodeString.pdf: generated with original Zend Framework
- test_no_encodeString.pdf: generated after having modified Zend_Pdf_Resource_Font::encodeString() this way:
public function encodeString($string, $charEncoding)
{
return $string;
}
Text is generated calling drawText this way:
$pg->drawText("a -> à", $x, $y);
$pg->drawText("e -> è", $x, $y);
$pg->drawText("i -> ì", $x, $y);
$pg->drawText("euro -> ".chr(128), $x, $y);
I can see the symbols in the second file and not in the first (I open the files both on linux and windows, they look the same).
I noticed that the characters 'à', etc. are recognized as invalid by the iconv function in encodeString.
For example, if I remove the //IGNORE statement for the output encoding, trying to render the text:
Test àà write
The result is:
Test
While leaving the //IGNORE statement the result is
Test write
Thanks for your help,
Frank
P.S.
According to this:
http://en.wikipedia.org/wiki/Windows-1252
It looks that the euro symbol is included in this encoding, along with accented letters like 'à' and 'ì'. In fact I produced pdf documents with the euro symbol with tools like gs.
Thanks
Assigning to Alexander.