Page 1 of 2
[SOLVED] problem with pdf plugin
Posted: Tue Sep 05, 2006 5:55 pm
by soylentgreen
hi,
i installed s9y with utf-8 charset. i would like to use the pdf-plugin from spartacus. but there seems to be a problem with the fonts whenever i choose updf / unicode support. the margin between the letters is quite big, so it would not fit on the page
if i disable unicode support, the text fits right, but some special characters seem to be broken...
is there an easy way to use smaller gabs between the letters in the updf plugin or to fix the broken chars?
Re: problem with pdf plugin
Posted: Tue Sep 05, 2006 6:06 pm
by garvinhicking
Hi!
Could you give us a URL to such a PDF that seems broken? Maybe one PDF with Unicode-support enabled, and one without, so that we can see both problems?
Regards,
Garvin
Posted: Tue Sep 05, 2006 6:33 pm
by soylentgreen
Posted: Tue Sep 05, 2006 6:33 pm
by soylentgreen
i generated it under mac os X but under the linux server, where it will be deployed, it has the same issues
Posted: Tue Sep 05, 2006 6:43 pm
by garvinhicking
Hi!
Hm. This seems to be a problem of the UFPDF library that we bundle; it uses special calcuations for string widths.
Since I only used the library and don't really know how it works itself, I'm left clueless. Maybe you could ask the authors of UFPDF if they know of to fix it? The file tells me that 'steven at acko dot net' is/was responsible for the file.
Without unicode the strings are not displayed properly, because FPDF does not support unicode. So this was the reason why UFPDF was used.
Best regards,
Garvin
Posted: Tue Sep 05, 2006 7:31 pm
by soylentgreen
akko.net says this:
Note: I wrote UFPDF as an experiment, not as a finished product. If you have problems using it, don't bug me for support. Patches are welcome though, but I don't have much time to maintain this.
the problem seems to be well known but the workaround suggested there doesn't seem to work for me. neither is there a newer version than 0.1...
could it be possible to convert the data from utf-8 to work in fpdf?
Posted: Tue Sep 05, 2006 7:40 pm
by garvinhicking
Hi!
I suppose you could use "utf8_decode" everywhere in the blogpdf plugin where output is made to maintain your PDF in ISO-8859-1 charset. You could try that of course!
Best regards,
Garvin
Posted: Wed Sep 06, 2006 1:02 am
by soylentgreen
the utf8_decode works perfectly. maybe this could make its way into the official plugin?
Posted: Wed Sep 06, 2006 8:45 am
by garvinhicking
Hi!
Not really; utf8_decode only works with latin1 languages like german.
If ut8_decode were used on a russian charset, it would throw away half of the carhacters
Regards,
Garvin
Posted: Wed Sep 06, 2006 2:44 pm
by soylentgreen
maybe a fallback function for latin-1 languages would be nice... i can rewrite the plugin so you can choose it in its properties... maybe someone else has similar issues with a latin-1 language
Posted: Wed Sep 06, 2006 3:08 pm
by garvinhicking
Hi!
But how would you detect if you are using a compatible or non-compatible language? All UTF-8 languages say they're UTF-8. We can't know if somebody only has latin characters, unless he explicitly tells us so.
So only another config option "use utf8_decode" would make sense. But then again, I'd prefer if someone could fixup ufpdf so that UTF-8 really works.
Best regards,
Garvin
Posted: Thu Sep 07, 2006 6:01 pm
by soylentgreen
i have updated the plugin, if anyone is interested in the patch, message me and i will upload it to the public.
and i agree to you that a clean UTF-8 support would be much better, but the development of UFPDF didn't progress for almost two years now.
so this might be useful for all user that have a latin charset for the time being
Posted: Fri Sep 08, 2006 9:45 am
by deurk
Since it is talking about the PDF plugin... I have a question.
Why are the images not included in the PDF?
Posted: Fri Sep 08, 2006 10:24 am
by garvinhicking
Hi!
Soylentgreen: Your patch would be VERY appreciated, then I could officiall ypatch the plugin with it?
Deurk: Transforming HTML markup into PDF markup is a completely different world. It is next to impossible to convert an image with all its alignment options et al into the PDF.
Best regards,
Garvin
Posted: Fri Sep 08, 2006 11:34 am
by deurk
What about just including the image, even if it is at then end of the PDF article? Or at least have the option to
