Jun 20, 2013; 07:20
Jolle Carlestam
Confused by encoding issues in pdfs
We had a client report an error in a pdf procedure that's been working for years. High ASCII chars were corrupted from the resulting pdf.
Tracking the cause I found it was how we setup the font object.
This is the code we were using:
local(arial_font = pdf_font(
-face = file_forceRoot('/_site/_fonts/Arial Narrow.ttf'),
-embed,
-encoding = 'UTF-8',
-size = 10))
Calling it like this:
#pdf -> add( pdf_text('R=E4ksm=F6rg=E5s My=E9 Wh=E1t\r',
-type = 'paragraph',
-font = #arial_font),
-height = 65,
-width = 400,
-left = 125,
-top = 183)
produced this:
R=C3=A4ksm=C3=B6rg=C3=A5s My=C3=A9 Wh=C3=A1t
But when I take out the UTF-8 param it works?!
local(arial_font2 = pdf_font(
-face = file_forceRoot('/_site/_fonts/Arial Narrow.ttf'),
-embed,
-size = 10))
#pdf -> add( pdf_text('R=E4ksm=F6rg=E5s My=E9 Wh=E1t\r',
-type = 'paragraph',
-font = #arial_font2),
-height = 65,
-width = 400,
-left = 125,
-top = 203)
-> R=E4ksm=F6rg=E5s My=E9 Wh=E1t
This really confuses me. We have been creating all our pdf_font objects using -encoding = 'UTF-8' for several years. And produced at least +50000 pdfs since. To not have any of those pdfs containing extended ASCII chars is highly unlikely. So why did this happen now? Our conclusion is that it has to be a recent change in the pdf library causing this. Can someone with an older version of Lasso 9 make a test? I can provide test code including the fonts used if need be.
Error shown on Lasso 9.2.6 on Centos 5.whatever.
HDB
Jolle
#############################################################
Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso
Lasso@lists.lassosoft.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Jun 20, 2013; 08:06
Brad Lindsay
Re: Confused by encoding issues in pdfs