Titanium Community Questions & Answer Archive

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

pdf in webview in scrollableview on android

Hi people

Here is my code:

var win = Titanium.UI.currentWindow;

var view1 = Titanium.UI.createWebView({url:'http://www.x.com/x.pdf'});

var scrollView = Titanium.UI.createScrollableView({


The Pdf won't load/show.

Can anyone help me?


— asked November 10th 2010 by chef koch
  • android
  • pdf
  • scrollableview
  • webview

3 Answers

  • iPhone's web views support PDFs. Android's do not.

    I hope you have gotten that answer in the last four weeks, but just in case you have not… To view a PDF on Android, the phone needs to download the PDF and then launch a 3rd party app like Adobe Reader or ThinkFree Office – one usually comes bundles with the phone. So to open a PDF on Android, you need to call:


    I wrote about some additional gotchas related to this on a different Q&A, including workarounds for all of them. (Hint: The above code won't work on some HTC Android devices, because the proper intents are not set.)


    — answered December 7th 2010 by Dawson Toth
  • Just tested this code and it works, down know if there is a problem with your URL or something. I would suggest testing the URL but the code you have provided looks correct

    var win2 = Titanium.UI.createWindow({
        title : 'Test PDF',
        backgroundColor : '#fff'
    var webview0 = Titanium.UI.createWebView({
        url : 'http://assets.appcelerator.com.s3.amazonaws.com/docs/API_UITableViewClass.pdf'
    var webview1 = Titanium.UI.createWebView({
        url : 'http://assets.appcelerator.com.s3.amazonaws.com/docs/API_TitaniumModule.pdf'
    var scrollView = Titanium.UI.createScrollableView({
    — answered November 10th 2010 by Aaron Saunders
    • Are you running that code on Android or iPhone, Aaron?

      — commented November 10th 2010 by Dawson Toth
    • my code run on iphone but not on android…

      — commented November 12th 2010 by chef koch
    • the question referred to an Android phone

      — commented December 13th 2010 by Alberto Marcone
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.