geektron has asked for the wisdom of the Perl Monks concerning the following question:
I have accented characters (á, for example) stored in a mysql database. HTML rendering is fine without converting the characters to HTMLEntities, but when I try to create a PDF with the same data and PDF::Template, I get a mangled "~Aj" combination.
From this google groups thread, setting a pdf_encoding in the xml template would be sufficient, e.g.:
<pdftemplate name="masterList" pdf_encoding='ISO-8859-1'>
But when I add pdf_encoding to my template, I get the following error:
PDFlib Error [1552] PDF_findfont: Font 'Helvetica' with encoding 'ISO-8859-1': Couldn't find encoding 'ISO-8859-1'
I've tried 'latin1', 'iso-8859-1', and 'utf-8' as valid encodings, but each one throws the above error (with the encoding substituted, of course).
I'm presuming the error is with PDFlib (it's throwing the error), but I'm hoping someone here has dealt with the same (or similar) issue and can give me a pointer or two.
EDIT 1) condensed template.xml
<pdftemplate name="masterList" pdf_encoding='iso8859-1'> <pagedef PAGE_WIDTH="612" PAGE_HEIGHT="792"> <font face="Helvetica" h="10"/> <LOOP NAME="ROWS"> <section> <row x='30' h="20"> <LOOP NAME='COLUMN'> <textbox w="50%"><VAR NAME="FIRST_NAME"/> <VAR NAME="LAST_NAM +E"/></textbox> </LOOP> </row> </section> </LOOP> </pagedef> </pdftemplate>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: PDF::Template and character encodings
by stvn (Monsignor) on Oct 15, 2007 at 22:35 UTC | |
by geektron (Curate) on Oct 16, 2007 at 14:14 UTC | |
by stvn (Monsignor) on Oct 16, 2007 at 16:54 UTC | |
Re: PDF::Template and character encodings
by shmem (Chancellor) on Oct 15, 2007 at 21:45 UTC | |
by geektron (Curate) on Oct 15, 2007 at 21:53 UTC | |
by shmem (Chancellor) on Oct 15, 2007 at 22:15 UTC | |
by geektron (Curate) on Oct 16, 2007 at 14:02 UTC | |
by shmem (Chancellor) on Oct 16, 2007 at 15:13 UTC | |
|