-
31 May 2012 2:11 PM #1
Unanswered: Displaying PDF's and other non-HTML content in a Sencha Touch App
Unanswered: Displaying PDF's and other non-HTML content in a Sencha Touch App
I'm working on creating an iPad friendly version of a web application my company sells. One of the main features of the web application is the ability to search for information provided by our company and then being able to download some application specific PDF's and other files. In the web application, we simply do a
to get the browser to download and display the report. However, this doesn't work very well on the iPad. For one thing, the user needs to go 'back' to the application after viewing the PDF. Also, we would like our iPad app to run without the status bar in which case there wouldn't be a back button at all.Code:location.href = report_url;
Is there a recommended way for Sencha Touch applications to download and display content such as PDF's?
Any help would be greatly appreciated.
Thanks.
Jim
-
1 Jun 2012 10:46 AM #2
-
3 Jun 2012 12:57 PM #3Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
- Answers
- 3111
Try opening up a new window. Using PDF within an app is not going to give a good user experience at all.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
3 Jun 2012 1:11 PM #4
but i want a button, when the user taps it, the download should start (to the device).
how to do that?
-
3 Jun 2012 1:54 PM #5Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
- Answers
- 3111
mobile safari won't let you download to the device.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
4 Jun 2012 5:47 AM #6
That works, but only if the user hasn't turned off pop-ups and if the app isn't running in standalone mode. It wouldn't be so bad if the user could whitelist a URL and selectively allow pop-ups, but if pop-ups are turned off, the user doesn't even get a notification that anything happened.
Jim
-
22 Aug 2012 5:50 AM #7
this function open the doc in new tab
this function open the doc in new tab
I'm using this solution in browser, but I d'ont have solution for sencha app :
I hope Sencha develop a document manager.Code:download: function(doc_url, title) { var link = document.createElement('a'); link.setAttribute('id', 'link_to_remove'); link.setAttribute('href', doc_url); link.setAttribute('target','_blank'); var clickevent = document.createEvent('Event'); clickevent.initEvent('click', true, false); link.dispatchEvent(clickevent); return false; }
-
2 Sep 2012 11:27 PM #8
did somebody find a solution for this ?
did somebody find a solution for this ?
Hi,
I am also trying to achieve something similar, I want to display pdf through sencha (native app for android and iOS). Is there any workaround to display the pdf through sencha.
Thanks,
Mayank
-
2 Sep 2012 11:40 PM #9
Does this not help?
Does this not help?
Doesn't this help? It's only just been released...
http://www.sencha.com/forum/showthre...ure-JavaScript
-
2 Sep 2012 11:54 PM #10
thanks for sharing link
thanks for sharing link
thanks for sharing the link will try this out in a little while.


Reply With Quote
