Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Posts: 28
Registered: ‎07-04-2013
My Device: BB, 86ABC
My Carrier: IDEA

Sample code to load pdf file from server in WebView using url

I want to load a pdf file in Webview of passing a url to it. I tried it of passing a url to webview directly, but its not working. Thanks in advance.

Posts: 252
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: Sample code to load pdf file from server in WebView using url

[ Edited ]

Hi KishoreTalloju, 


You can implement the same behavior of the BlackBerry 10 native browser in your application.


In order to achieve this behavior, have an if statement that checks if the url property of the WebView contains ".pdf". Then if it does, use a FilePicker object in saver mode to allow the user to save the file locally.


This is how the BlackBerry 10 browser operates for e.g. with this url: http://www.passport.gc.ca/form/pdfs/pptc153.pdf



Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker