Page 1 of 2

Include PDF in build

Posted: Sat May 25, 2013 7:21 am
by migs

I should start by saying that, as a web designer, and not an app developer, most of this is new to me.

I've managed to develop a basic app that has collapsible blocks. These contain images which currently function as links to to PDF files, and which open perfectly well when clicked, but I'm looking to include the PDFs in the build.

I've created a database, and I know I can upload files into it, but that's where I hit a wall. Is there a simple and reasonably elegant method of loading those files from the present icons/links I have in the app?

I have no experience of using APIs, and I think this personal limitation is what's causing me the problem. My javascript skills are also pretty - well, very - basic.

If anybody can offer any guidance to what I should do, I'd be grateful. The app, as it is is perfectly functional but, of course, it currently requires a data/wifi connection to get the files, and I'm trying to get around that.


Include PDF in build

Posted: Sat May 25, 2013 7:31 am
by Alena Prykhodko

Hi!

Under "loading from present icon/links" do you mean loading .pdf when you click icons/links?
How to work with files look please here http://docs.appery.io/documentation/b...


Include PDF in build

Posted: Sat May 25, 2013 8:22 am
by migs

Hi Alena

Thanks for the very quick answer.

Yes, I currently have the files downloading from my own server when an image is clicked.

I'd seen that the link you give but, unless I don't understand properly, this will simply link to the file in the remote database, rather than downloading from my own server?

I want to include the files in the app when it is installed, to avoid having to download them via data/wifi when the image is clicked. Is there any way to do this?

Alternatively, if I do use the database link to load the files the first time, is it possible to then retrieve them locally from the device, rather than requiring a data connection every time?

Please forgive my lack of knowledge


Include PDF in build

Posted: Sat May 25, 2013 9:10 am
by Alena Prykhodko

You can bundle your remote files, just insert reference to file on Events tab for Image component: Image
or for Link component:
Image

But to store it you'll need to use local storage or Appery.io database

Also look the similar question
https://getsatisfaction.com/apperyio/...


Include PDF in build

Posted: Sat May 25, 2013 10:37 am
by migs

Ah, okay.

I t looks like I misunderstood the function of the "Navigate to Link" event and the URL in the Link properties. I assumed this would just be a basic link to a remote file.


Include PDF in build

Posted: Sat May 25, 2013 3:56 pm
by Igor

If you want that you app is viewing pdf files in offline mode the best way to implement this is use Backend Services and Phonegap Api.
On the first time when App is loading you can get list pdf url from Backend Service.
Then store selected pdf to device file system. After that you can view pdf files without connection to internet.
But It's not easy to implement this.


Include PDF in build

Posted: Sat May 25, 2013 4:14 pm
by migs

Hi Igor

Thanks for the advice. I will try and make it work, it will be good experience for me :)


Include PDF in build

Posted: Sun Nov 03, 2013 2:27 am
by pakbull

I need to configure this base functionality. The user can view a list of PDF documents and then click a few selected ones. These then get downloaded to a local storage / database and are then available offline.

I have been able to add links to these PDF files on the website, but when clicked, it opens in a new window (while running in emulator) and I can't seem to go back to the PDF list page. Also, dont know how to capture the downloaded PDF into a variable that then can be stored in a local storage or local db.

Thanx


Include PDF in build

Posted: Sun Nov 03, 2013 4:33 pm
by Igor

Hello,

It's not a good way to save .pdf file to localStorage variable if you want to use files in offline mode. You can use device file system fro this. Please take a look at PhoneGap API to work with file system: http://docs.phonegap.com/en/3.0.0/cor...


Include PDF in build

Posted: Tue Oct 28, 2014 12:37 pm
by Richard McCutcheon

Can you give me a run through of how this can be done please Igor