Wrong codepage in the form fields

Hello,

I have discovered an issue with PDF include - when you use it to fill pdf forms using non-standard character set (CP1250 in my case), the character codepage in the form fields gets wrong. Also, character width is sometimes messed up.
I use most current SVN version of PDF include and OpenOffice 3.2 to generate forms (tried 3.1 as well, with same result).
PDF file structure is a kind of mystery for me, so it's possible that my analysis went in quite wrong direction, but there is what I discovered:
- Forms generated by OO have fonts of form fields defined by abbreviate names, like /TiRo for Times Roman and so on
- It seems that correct codepage appears in generated PDF only for built-in fonts (defined as /BF(n) )
- pdf_inc.p runs pdf_resources before pdf_content. So if particular font is used only in the form field, and not in the formular body then it's definition (widths for example) does not get into pdf file

I made some quick update into pdf_inc.p. Basically I did two things:
- replaced font names in the forms from abbreviations to built-in definitions (for Arial and Times New Roman only, as I understand from other posts Courier does not work anyway).
- removed usage of TT_pdf_font.used_flag so all fonts gets into pdf (I know it's dirty...)

If you are interested, please let me know, but I believe that the author will be able to do it much cleaner than me.

Regards,

Piotr


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

codepages

Hi Piotr
You must indeed be right. I have never tried with "special" codepages, but as it takes the font as defined in the pdf form, then the characters are the ones defined in the software used to generate the pdf form.
Your solution seems ok, but I still have to investigate how to implement it for the general case.
Thanks for pointing this to me!
Regards
Jice