Re: Opening pdf,pptx,docx,xlsx files in iOS phonegap/cordova app.

3,507 views
Skip to first unread message

Ethernaly

unread,
Aug 1, 2012, 4:14:50 PM8/1/12
to phon...@googlegroups.com
I think you have to add "QuickLook Framework" to your project, and add class to your appDelegate

Menno Bieringa

unread,
Aug 1, 2012, 5:53:32 PM8/1/12
to phon...@googlegroups.com
Hi Suraj,

I'm not sure about your situation, but I found myself downloading base64 encoded PDF's to my app which I then needed to display.
I also use Phonegap 2.0.0

My solutions:
Android:
Modified a plugin that allows me to store the downloaded file on the SD Card.
After storing it, an intent is thrown that offers the file to the system's PDF reader(s). (If any)

I based my code on: http://stackoverflow.com/questions/11388018/phonegap-plugin-to-convert-base64-string-to-a-png-image-in-android
This works like a charm for me.

iOS: I use the childbrowser plugin to have the PDF opened via direct URL input
Instead of opening a URL like www.somewhere.com/something.pdf I just pass it a url like:
data:application/pdf;base64,YOURBASE64DATAHERE


That works like a charm for me but my PDF document is only 1 page with a small graphics and a bunch of text.
I have not tested large(r) documents.

I currently don't have time to put this stuff online and turn in into a tutorial but I will asap.
(Or pay me, then I'll make time :-P )


Francisco

unread,
Aug 2, 2012, 1:24:25 AM8/2/12
to phon...@googlegroups.com
Take a look at this commit ;)




On Wednesday, August 1, 2012 9:05:04 AM UTC-4:30, Suraj Aair wrote:
Hi,

I am working on an app in which i need to open the above listed files in their default application. For now, I have managed to view the files in ChildBrowser Plugin. But, the requirement is to open these files in native apps. If anybody can suggest me phonegap/cordova plugin it would be really great. I am using cordova2.0 with Xcode 4.2. 

Thanks,
Suraj 
Reply all
Reply to author
Forward
0 new messages