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
|