Print Page | Close Window

Form field and greek fonts issue

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1491
Printed Date: 06 May 25 at 12:08PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Form field and greek fonts issue
Posted By: stakon
Subject: Form field and greek fonts issue
Date Posted: 17 Jun 10 at 8:00AM
Good day!

I have some experience with the QuickPDF library from some projects in the past, but i've never needed (until now) the forms/fields functionality.

So here are some problems i encountered:

First of all it was a bit confusing to find which fonts are used within the forms. The forms were created with Adobe Acrobat 9 Pro Extended. In each field we set the font to Arial. By editing the form with Acrobat viewer it was possible to enter greek text.
Now i try to add text with the QuickPDF in a field.

My first try: simply add a string value in a field

pdf_dll->SetNeedAppearances(1);//when loading the document
//for the field i , I do the following:
pdf_dll->UpdateAppearanceStream(i);
pdf_dll->SetFormFieldValue(i,str);//i set a value in the field
....
//Save document

If the str value is english text everything is fine. If i try to pass greek text, nonsense is written in the field.

My second try: i add and embed a new font and use it instead of the one used by the form creator.

pdf_dll->SetNeedAppearances(1);//when loading the document

//for the field i , I do the following:
int form_font = pdf_dll->AddTrueTypeFont("Arial {1253}",1);//Add a greek arial font and embed it
int res = pdf_dll->AddFormFont(form_font);//Add the font in the form. res returned is the number of fonts available in the form (also the index of this lastly-added font.
pdf_dll->SetFormFieldFont(i,
res );
pdf_dll->UpdateAppearanceStream(i);
pdf_dll->SetFormFieldValue(i,str);//i set a value in the field
....
//Save document

By using this the results are weird. I can see greek text by using the QuickPDF viewing capabilities (RenderToDC) but when opening with Adobe Acrobat, the field shows nothing!

Thanx in advance for any guidance upon the issue,
stakon

Note: I am developing in C++ the 7.18 dll version of the library.



Replies:
Posted By: stakon
Date Posted: 21 Oct 10 at 8:42AM
-bump

It has been several months since i first posted this, so i bring it once again to your attention in case someone can provide some help.





Posted By: Wheeley
Date Posted: 21 Oct 10 at 8:10PM
Two things to try.

1. Try a later version of the library like 7.21.
2. Make sure the string you pass to the DLL which sets the value is formatted as UTF-8.

Wheeley



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk