Print Page | Close Window

Android : Writing Special Characters To Form Field

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=3282
Printed Date: 29 Apr 25 at 10:28AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Android : Writing Special Characters To Form Field
Posted By: Ludwig
Subject: Android : Writing Special Characters To Form Field
Date Posted: 15 Mar 16 at 1:02PM
I am attempting to write special Characters to a PDF acro text field using the Android library of QuickPdf v12.12.

I use the following code:

               /*I use 18 as it corresponds to Mac CharacterSet which contains the character I wish to write*/
                String value = mDQPL.GetInstalledFontsByCharset(18, 0);

              /*I chose a font from the list returned above*/
String[] fonts = value.split(",");
String fontToEmbed = fonts[0].replace("\"", "");

               /*I embed the font*/
int embedded = mDQPL.AddTrueTypeFont(fontToEmbed, 1);
int fontCount = mDQPL.AddFormFont(embedded);
int formFieldCount = mDQPL.DAGetFormFieldCount(fileHandle);

               /*I set the embedded font as a Form Field Font*/
                for (int i = 1; i <= formFieldCount; i++) {
if (mDQPL.GetFormFieldType(i) == 1) {
String name = mDQPL.GetFormFieldFontName(i); 
int set = mDQPL.SetFormFieldFont(i,fontCount);
String v = "\u00C2";
        mDQPL.SetFormFieldValue(i, v);
}
}
mDQPL.SaveToFile(FileOpHelper.returnRootDirectory(context)+"/temmm1.pdf");
mDQPL.DACloseFile(fileHandle);

But I do not get any output the PDF remains blank. This happens with every pdf.

Please Note: The list of Fonts Installed, filtered by Charset, returned is as follows:
  
  "AndroidClock Regular","AndroidClock-Large Regular","AndroidClock-Large Regular","Android Emoji Regular","AnjaliNewLipi Regular","Clockopia Regular","Roboto Bold","Roboto Regular","Droid Sans Armenian Regular","Droid Sans Ethiopic Regular","Droid Sans Fallback Regular","Droid Sans Georgian Regular","Droid Sans Hebrew Bold","Droid Sans Hebrew Regular","Droid Sans Mono Regular","Roboto Regular","Droid Serif Bold","Droid Serif Bold Italic","Droid Serif Italic","Droid Serif Regular",
"GS45_Arab(AndroidOS) Regular","GS_Thai Regular","Lohit Bengali Regular","Lohit Kannada Regular","Lohit Telugu Regular","MotoyaLMaru W3 mono","Roboto Bold","Roboto Bold Italic","Roboto Italic","Roboto Light","Roboto Light Italic","Roboto Regular","Roboto Condensed Bold","Roboto Condensed Bold Italic","Roboto Condensed Italic","Roboto Condensed Regular","SamsungBengali Regular","SamsungDevanagari Regular","SamsungGujarathi Regular","SamsungKannada Regular","SamsungMalayalam Regular","SamsungOriya Regular","SamsungPunjabi Regular","SamsungSinhala Regular","SamsungTamil Regular","SamsungTelugu Regular","Droid Naskh Shift Alt Regular","Droid Arabic Naskh Regular","Georgia Bold","Georgia Bold Italic","Georgia Italic","Georgia Regular","HelveticaNeue Thin","NanumGothic Regular","Roboto Thin","Roboto Thin Italic","SamsungKorean Bold","SamsungKorean Regular","SamsungThai(test) Regular



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