[SOLVED] problem with pdf plugin

Creating and modifying plugins.
soylentgreen
Regular
Posts: 28
Joined: Sun Aug 20, 2006 2:54 pm

[SOLVED] problem with pdf plugin

Post 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?
Last edited by soylentgreen on Wed Sep 06, 2006 1:03 am, edited 1 time in total.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: problem with pdf plugin

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
soylentgreen
Regular
Posts: 28
Joined: Sun Aug 20, 2006 2:54 pm

Post by soylentgreen »

soylentgreen
Regular
Posts: 28
Joined: Sun Aug 20, 2006 2:54 pm

Post by soylentgreen »

i generated it under mac os X but under the linux server, where it will be deployed, it has the same issues
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
soylentgreen
Regular
Posts: 28
Joined: Sun Aug 20, 2006 2:54 pm

Post 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?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
soylentgreen
Regular
Posts: 28
Joined: Sun Aug 20, 2006 2:54 pm

Post by soylentgreen »

the utf8_decode works perfectly. maybe this could make its way into the official plugin?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
soylentgreen
Regular
Posts: 28
Joined: Sun Aug 20, 2006 2:54 pm

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
soylentgreen
Regular
Posts: 28
Joined: Sun Aug 20, 2006 2:54 pm

Post 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
deurk
Regular
Posts: 40
Joined: Wed Jun 21, 2006 5:36 pm

Post by deurk »

Since it is talking about the PDF plugin... I have a question.
Why are the images not included in the PDF?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
deurk
Regular
Posts: 40
Joined: Wed Jun 21, 2006 5:36 pm

Post 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 :P
Post Reply