Android Question pdfwriter char encoding issue

GudEvil

Member
Licensed User
I am retriving indian (marathi) text from mysql with utf-8 charset.

This records are displaying correctly in label/text fields etc.

but when I tried to create pdf with this text, it creates pdf but with strange symbol showing..

I am new in encoding...

B4X:
                    ProgressDialogShow("Generating Document.")
                   
        pdfwriter1.Initialize("PDFWriter1",pdfsize.A4_WIDTH, pdfsize.A4_HEIGHT)
'                    pdfwriter1.setFont2(fonts.SYMBOL, fonts.TIMES_ROMAN,"ISO-8859-1")
        pdfwriter1.setFont(fonts.SUBTYPE,fonts.SYMBOL)

    pdfwriter1.addText(15,800,12,values1(1).Text)
    pdfwriter1.addText(15,600,12,"it is its ..yup it is")
    pdfwriter1.addText(15,400,12," कार्यालय ")
    pdfwriter1.ConverseDocument

B4X:
Sub PDFWriter1_ConversionDone (Content As String)
    ProgressDialogHide
    ToastMessageShow("Conversion has been done.",False)
'    pdfwriter1.outputToFile(File.DirRootExternal,"myNewPDF66.pdf",Content,"UTF-8")
    pdfwriter1.outputToFile(File.DirRootExternal,"myNewPDF66.pdf",Content,"ISO-8859-1")
    ToastMessageShow("PDF Saved.",False)
End Sub


english letters are showing correctly but no other char (marathi_indian)

(1) can external typeface (custom font) can be used?? how??
(2)can
pdfwriter1.addRawContent(string)
will work
(3) can I convert sql_retrieved data to iso-8859-1 n then use pdfwriter1.addtext()
will it work??? how


I tried many given fonts but might be missing simple logic by choosing correct charset
 
Top