Loading a PDF file in Titanium may be sometimes our requirement for an application. For loading a PDF we need to have a webview inside a scrollview so that it is scrollable also. Take a look at this simple example.
/** creating a window **/ var window = Titanium.UI.createWindow{}; /** creating a webview **/ var my_webview = Titanium.UI.createWebView({ url :'my_pdf.pdf' //specify the PDF path.....}); /** creating a scrollview **/var my_scrollView = Titanium.UI.createScrollableView({ views:[my_webview] // placing the webview inside the scrollview...}); window.add(scrollView);
Please leave your valuable comments if this post was useful…..