This is a migrated thread and some comments may be shown as answers.

Adding PDF's to project, then displaying them.

5 Answers 45 Views
AppBuilder Windows client
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sean
Top achievements
Rank 1
Sean asked on 26 Jan 2016, 09:06 AM

I need to include about 60MB of PDF files into the project, then display them in the App.  I am familiar with File plugin and have used it, but I was wondering what is the ideal location to store them in the project, and then do I need to copy the files over to another location on first run of the application?  These files will be updated from time to time by a WebService.

 

Any thoughts would be appreciated.

 

Thanks.

5 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 29 Jan 2016, 09:04 AM
Hi Sean,

From the perspective of developing hybrid apps with AppBuilder, there are not specific recommendations to suggest on how to add a pdf file to the project. Since in Telerik Platform you can build various mobile applications leveraging Cordova, you can review Cordova plugins which would work better for you. 

Regards,
Dimitrina
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
Sean
Top achievements
Rank 1
answered on 29 Jan 2016, 01:46 PM

I am going to store them in a data directory initially, then copy them at start up to the persistent file area when they are updated.

 

0
Carlos
Top achievements
Rank 1
answered on 01 Feb 2016, 10:29 PM

60MB is a huge file for the user to download and put on their phones. I would suggest hosting them on a site and let the user download it if they want.  Either put a link to it or host it.

 What we did was made a hosted site that I put a webpage up and uses PDF.js (https://mozilla.github.io/pdf.js/)

 You can then host your PDF there and let PDF.js render the PDF and there is a bunch of built in tools and a download button if the user wants to do that.

PDF.js is great because you can have one webpage and append the PDF Url to the end with a Query string, and the PDF renders in the browser.  

You can see an example here of what we did. The PDF has to be local on the same domain, otherwise you may run into some CORS issues, but it works great for us.

http://econtent.dmns.org/home/join/memberships/catalyst/catalyst-viewer/?file=http://econtent.dmns.org/media/1258/february-march-2015-catatlyst-resized.pdf

 

 

0
Sean
Top achievements
Rank 1
answered on 04 Feb 2016, 11:21 AM

Thanks Carlos for taking the time to reply.

 A couple of differences though, they need to have access to the PDF's if offline, and it isnt one big 60MB PDF, its 334 individual PDF's that appear as manufacturer alerts for a medical device.  The download isnt the problem, takes about 60 secs to download, but takes about 4 minutes to write them back to a DB on the phone.  Including them in the IPA then allowing them also to download seems to be the only solution so far.

 

0
Carlos
Top achievements
Rank 1
answered on 04 Feb 2016, 04:48 PM

Ahhh . I see now.  Yes, that is probably your only solution.   
We looked at doing this for our solution as well.  A Webservice that can ping the app and let the app know there is a new file.  I would definitely look at storing the PDF's onto the file system, not in the DB on the phone. From my understanding, the local DB on a phone is only about 100mb because it is running through web storage or webSQL (https://cordova.apache.org/docs/en/latest/cordova/storage/storage.html).  And as you have seen is slow.  I don't even think the Web Storage is an active project anymore in HTML5.  Might want to be careful of that too.

 I would write directly to the phones file system. But have you app create a folder in the Phone's file system that all your PDF's would go to and that you would read and write from. 

You would also use the Push Notification plugin or even the In-App notifications plug in (a little more robust) and let the user know they have a new PDF to download and they can then download it themselves.  

Hope any of this helps. Sounds like you have a decent handle on a solution so far. Files are always tricky with mobile app development.

Tags
AppBuilder Windows client
Asked by
Sean
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Sean
Top achievements
Rank 1
Carlos
Top achievements
Rank 1
Share this question
or