Thursday, 15 August 2013

javascript - Write base64 string as pdf to phone storage using Phonegap -



javascript - Write base64 string as pdf to phone storage using Phonegap -

i have requirement write pdf phone storage using phonegap, phonegap supports text writting in file. have base64 string contains pdf doc, , want save phonestorage. have tried convert base64 utf-8 using atob function , write pdf, not working.

is there else should try? or there plugin available?

any help appreciated.

create normal pdf author method in java. same itext or other pdf writers can used. expose public method in author class javascript interface. eg :

class pdfwriter{ @javascriptinterface public void writetopdf(string datatobewritten) { writetofile(datatobewritten); } }

register javascriptinterface webview.

once webview loaded, should able call:

window.pdfwriter.writetopdf("data_to_be_written")

javascript pdf cordova

No comments:

Post a Comment