Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Filling form fields with greek letters
  FAQ FAQ  Forum Search   Register Register  Login Login

Filling form fields with greek letters

 Post Reply Post Reply
Author
Message
LQ View Drop Down
Beginner
Beginner


Joined: 02 Apr 12
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote LQ Quote  Post ReplyReply Direct Link To This Post Topic: Filling form fields with greek letters
    Posted: 02 Apr 12 at 10:39AM
Hi, I'm evaluating your Library and it looks great,

I'm trying to fill a ready made pdf Form from a database and save the form to pdf for each record.
It works fine but not for the Greek text , if the field value is mixed English and Greek only the English text appears!
If I open the pdf form in adobe reader I can write Greek text in the fields!
what I'm doing is:

QP.LoadFromFile(pdfFormFile);
QP.SetFormFieldValueByTitle(sField,sVal);

after I finish filling up all the fields:
for fIDX:=Qp.FormFieldCount-1 downto 0 do  QP.FlattenFormField(fIDX);

QP.SaveToFile(NewPDFName);

Any idea?
I tried Delphi 6 on Win XP and also Delphi XE on Win 7, same results.

Thanks

Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 04 Apr 12 at 4:08AM
Here is some code that words generates Greek text in a formfield.

The trick is you need to use  QP.AddFormFont(fid); to add the font to the formfield as formfields need their own fonts for some reason.

            QP.SetOrigin(1);

            string text = "ABCDEF ΕΚΑΤΟΝ ΟΓΔΟΝΤΑ ΕΠΤΑ ΕΥΡΩ και ΕΞΗΝΤΑ ΛΕΠΤΑ";

            int fid = QP.AddTrueTypeSubsettedFont("Arial", text, 0);
            //int fid = QP.AddSubsettedFont("Verdana" ,12, text);
            int ffid = QP.AddFormFont(fid);

            int id = QP.NewFormField("FirstName", 1);
            QP.SetFormFieldBounds(id, 10, 20, 300, 20);
            QP.SetFormFieldHighlightMode(id, 2);
            QP.SetFormFieldFont(id, ffid);
            QP.SetFormFieldValue(id, text);
            QP.SetFormFieldDefaultValue(id, text);

            QP.SetNeedAppearances(0);
            QP.UpdateAppearanceStream(id);

            QP.SaveToFile("out.pdf");
            Process.Start(@"out.pdf");

Back to Top
LQ View Drop Down
Beginner
Beginner


Joined: 02 Apr 12
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote LQ Quote  Post ReplyReply Direct Link To This Post Posted: 04 Apr 12 at 10:43AM
Thanks Andrew,
what is this Text string, and how to get it for a different language?
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 04 Apr 12 at 11:18AM
That is Greek test but this Forum changes the text to some other encoding.  It was perfect Greek when I posted it.

Andrewn
Back to Top
Renaud View Drop Down
Beginner
Beginner
Avatar

Joined: 12 Feb 20
Location: France
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Renaud Quote  Post ReplyReply Direct Link To This Post Posted: 28 Apr 20 at 11:41AM
Hello, 

did any one tried that successfully using ActiveX from php ?
(DebenuPDFLibrary64AX1613)

I copied the code from Andrew ( thank you Andrew) 

but I still have bad result for non Latin Char.

see result and code below.

ABCDEF ΕΚΑΤΟΝ ΟΓΔΟΝΤΑ ΕΠΤΑ ΕΥΡΩ και ΕΞΗÎ

    $qp->SetOrigin(1);
    //$text = "ёяшертыуиопющэъасдфгчйкльжзхцвбнм";
    $text = "ABCDEF ΕΚΑΤΟΝ ΟΓΔΟΝΤΑ ΕΠΤΑ ΕΥΡΩ και ΕΞΗΝΤΑ ΛΕΠΤΑ";
    $fid = $qp->AddTrueTypeSubsettedFont("Arial"$text2);
    $ffid = $qp->AddFormFont($fid);

    $id = $qp->NewFormField("FirstName"1);
    $qp->SetFormFieldBounds($id102030020);
        
    $qp->SetFormFieldFont($id$ffid);
    $qp->SetFormFieldValue($id$text);
    //$qp->SetFormFieldDefaultValue($id, $text);
    $qp->SetNeedAppearances(0);
    $qp->UpdateAppearanceStream($id);
    $qp->SaveToFile("out.pdf");
Back to Top
Renaud View Drop Down
Beginner
Beginner
Avatar

Joined: 12 Feb 20
Location: France
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Renaud Quote  Post ReplyReply Direct Link To This Post Posted: 02 Jul 20 at 6:40AM
Hello, 

Thanks to Kevin from support issue is solved.
here is support answer :

it is not Quick PDF Library but rather PHP that is the issue.

change from this:
$qp = new COM('DebenuPDFLibrary64AX1613.PDFLibrary');

to this:
$qp = new COM('DebenuPDFLibrary64AX1613.PDFLibrary', NULL, 65001);

Now the interface between PHP and ActiveX will be Unicode enabled, and everything works as expected.

and to embed a little char as required i use AddTrueTypeSubsettedFont  option 4

$latin_letters = 'A';
$fid = $qp->AddTrueTypeSubsettedFont("Arial Unicode MS", $latin_letters , 4);
$qp->SelectFont($fid);
$ffid = $qp->AddFormFont($fid);

so when I do that : 

$textRussian = "Нет никого, кто любил бы боль саму по себе,";
$qp->SetFormFieldValue($id, $textRussian );


the sub set is automatically updated with only required char.




Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store