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!
Filling form fields with greek letters |
Post Reply |
Author | |
LQ
Beginner Joined: 02 Apr 12 Status: Offline Points: 2 |
Post Options
Thanks(0)
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); after I finish filling up all the fields: for fIDX:=Qp.FormFieldCount-1 downto 0 do QP.FlattenFormField(fIDX); Any idea? I tried Delphi 6 on Win XP and also Delphi XE on Win 7, same results. Thanks |
|
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
|
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"); |
|
LQ
Beginner Joined: 02 Apr 12 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
Thanks Andrew,
what is this Text string, and how to get it for a different language? |
|
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
|
That is Greek test but this Forum changes the text to some other encoding. It was perfect Greek when I posted it.
Andrewn
|
|
Renaud
Beginner Joined: 12 Feb 20 Location: France Status: Offline Points: 8 |
Post Options
Thanks(0)
|
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", $text, 2); $ffid = $qp->AddFormFont($fid); $id = $qp->NewFormField("FirstName", 1); $qp->SetFormFieldBounds($id, 10, 20, 300, 20); $qp->SetFormFieldFont($id, $ffid); $qp->SetFormFieldValue($id, $text); //$qp->SetFormFieldDefaultValue($id, $text); $qp->SetNeedAppearances(0); $qp->UpdateAppearanceStream($id); $qp->SaveToFile("out.pdf"); |
|
Renaud
Beginner Joined: 12 Feb 20 Location: France Status: Offline Points: 8 |
Post Options
Thanks(0)
|
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. to this: $qp = new COM('DebenuPDFLibrary64AX1613. 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. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store