1. #1
    Sencha Premium Member
    Join Date
    Apr 2009
    Posts
    162
    Answers
    5
    Vote Rating
    7
    jhoweaa is on a distinguished road

      1  

    Default 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

    Code:
    location.href = report_url;
    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.

    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

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Posts
    55
    Answers
    1
    Vote Rating
    0
    twisted_zero is on a distinguished road

      0  

    Default


    I have the same question

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,789
    Answers
    3465
    Vote Rating
    833
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    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
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  4. #4
    Sencha User
    Join Date
    Mar 2012
    Posts
    55
    Answers
    1
    Vote Rating
    0
    twisted_zero is on a distinguished road

      0  

    Default


    but i want a button, when the user taps it, the download should start (to the device).
    how to do that?

  5. #5
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,789
    Answers
    3465
    Vote Rating
    833
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    mobile safari won't let you download to the device.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  6. #6
    Sencha Premium Member
    Join Date
    Apr 2009
    Posts
    162
    Answers
    5
    Vote Rating
    7
    jhoweaa is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Try opening up a new window. Using PDF within an app is not going to give a good user experience at all.
    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

  7. #7
    Ext Premium Member
    Join Date
    Jan 2010
    Posts
    31
    Vote Rating
    0
    ydi is on a distinguished road

      0  

    Default 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 :

    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;
        }
    I hope Sencha develop a document manager.

  8. #8
    Sencha User
    Join Date
    Jul 2012
    Posts
    13
    Vote Rating
    0
    kmayank is on a distinguished road

      0  

    Default 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

  9. #9
    Sencha User
    Join Date
    Aug 2011
    Location
    London
    Posts
    393
    Answers
    14
    Vote Rating
    16
    digeridoopoo will become famous soon enough

      0  

    Default 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

  10. #10
    Sencha User
    Join Date
    Jul 2012
    Posts
    13
    Vote Rating
    0
    kmayank is on a distinguished road

      0  

    Default thanks for sharing link

    thanks for sharing link


    thanks for sharing the link will try this out in a little while.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi