Is it possible : Displaying pdf in servoy mobile app

Discussions regarding developing applications using Servoy Mobile (new in Servoy 7)

Is it possible : Displaying pdf in servoy mobile app

Postby nestrocuation » Fri Aug 23, 2013 12:47 am

Hello ,

I have question , i want to display a pdf viewer in servoy mobile app which would take bytes from rest service.Is it possible using phonegap api or any other third party plugin .

Any ideas appreciated .Thanks
nestrocuation
 
Posts: 61
Joined: Tue Jun 08, 2010 11:27 pm

Re: Is it possible : Displaying pdf in servoy mobile app

Postby Andrei Costescu » Thu Sep 12, 2013 9:33 am

You need to have it embedded, not open up the phone's pdf viewer independently right (cause that should be doable)?

Here's an idea - didn't try it on mobile phones though - and it will go through google + it needs live internet connection + it needs to get the pdf directly, not through a web-service as bytes...
http://docs.google.com/viewer?url=www.m ... ochure.pdf

Maybe there are other ways of doing this as well. Just search a bit on how you could do this in mobile browsers.
And you should be able to use a custom Bean in the Servoy mobile app. that does the same.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 902
Joined: Tue Jun 26, 2007 3:14 pm

Re: Is it possible : Displaying pdf in servoy mobile app

Postby Andrei Costescu » Thu Sep 12, 2013 9:41 am

You might also find out there PDF to HTML converters. You will surely find some server side ones (which you could potentially use to send HTML or images to the client instead of PDF bytes).
If you also find some client-side JS that does this conversion it would be exactly what you need I guess.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 902
Joined: Tue Jun 26, 2007 3:14 pm

Re: Is it possible : Displaying pdf in servoy mobile app

Postby paronne » Fri Sep 13, 2013 2:13 pm

A solution tested for iOS is to open the pdf with a pdf Browser viewer by doing window.open('http://myDomain/myWeb-Services/documents/docID', '_blank')
The open target must be _blank or else will not be possible to navigate back from the pdf viewer.
Using cookies can let the user to authenticate and then to open the document.
Consider that when closing the pdf file, user will be redirected to the first page of the app; therefore the last page visited must be stored somewhere so to permit to be restored.

Unfortunatly this solution will not be enough for Android, since does not seems to support the pdf viewer inside the browser.
In this case i would follow Andrei suggestion's;
otherwise the phonegap API might help you, by let you save the pdf as a file, and then open it ( not really sure how and if is going to work, and i think that this solution is not valid for iOS instead )
paronne
 
Posts: 85
Joined: Fri Nov 02, 2012 3:21 pm


Return to Servoy Mobile

Who is online

Users browsing this forum: No registered users and 2 guests

cron