Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Viewing PDF's

Can you view PDF's inside a Titanium App or would making them jpgs be the way to go?

— asked March 22nd 2010 by Juan Bermudez
  • pdf
0 Comments

6 Answers

  • evalJS seams to be broken in Titanium on iOS 5.

    — answered October 15th 2011 by Mario Müller
    permalink
    3 Comments
    • did anyone find a solution for this?

      — commented November 21st 2011 by Alberto Marcone
    • just try to download that pdf file using httpClient method and on its response set

      webview.data = this.responseData;

      — commented November 21st 2011 by Mitul Bhalia
    • what about local pdfs? and why would that make a difference? still the same data would be loaded.

      — commented November 23rd 2011 by Alberto Marcone
  • You can display them using a webview.

    See web_views.js in KitchenSink.

    — answered March 22nd 2010 by James K
    permalink
    0 Comments
  • Hello, I executed the example present in kitchenSink but it show only the first pdf page whitout possibility to zoom in and out or change page.
    It's a my problem??

    — answered May 26th 2010 by Stefano Di Luca
    permalink
    0 Comments
  • @Mitul Bhalia

    I've tried this code as you mentioned
    (Note: my url is ending with pdf extention)

    var xhr = Ti.Network.createHTTPClient();
    
    xhr.open("GET", MyUrl.pdf);
    xhr.onload = function()
    {
        Ti.API.info('onload');
        try
        { 
            var wb = Ti.UI.createWebView();
             wb.data= this.responseData;
                 Ti.API.info(this.responseData);
    
             Titanium.UI.currentWindow.add(wb)
             }
             catch(r)
             {
                 alert(r)
             }
    }
    xhr.send();
    

    it hang-up when entering xhr.onload = function()
    even Ti.API.info('onload'); is not printed

    — answered November 27th 2011 by Haya aziz
    permalink
    4 Comments
    • What platform(s) are you targeting?

      — commented November 28th 2011 by Tony Lukasavage
    • can you provide url so i can test on my side….coz i have used this code in my app and running perfectly..

      — commented November 28th 2011 by Mitul Bhalia
    • I'm using Android,

      this is my tested url : http://www.kacst.edu.sa/en/about/publications/Books/Arabic_Origins_of_Cryptology5.pdf

      — commented November 30th 2011 by Haya aziz
    • oh…then try this url in webview

      http://docs.google.com/viewer?embedded=true&url=http://www.kacst.edu.sa/en/about/publications/Books/Arabic_Origins_of_Cryptology5.pdf

      — commented December 1st 2011 by Mitul Bhalia
  • just try to download that pdf file using httpClient method and on its response set

    webview.data = this.responseData;

    — answered October 21st 2011 by Mitul Bhalia
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.