Welcome!

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

Web and WebWorks Development

Reply
Regular Contributor
iruka
Posts: 79
Registered: ‎09-17-2012
My Device: Torch 9800
My Carrier: DiGi

How to View Pdf on Browser

Hi all. I trying to view pdf  on the browser but when I click on the link, it ask to save to the device instead. 

 

My code: 

 

strQPartiClaim += '<div class="particularsLabel">RECEIPT</div><div class="particularsValue"><span class="noLine" x-blackberry-focusable="true" onmouseover="pageHighlight(this)" onmouseout="noPageHighlight(this)" onclick="openLink(\''+partiReceipt+'\')">VIEW</span></div>';

 partiReceipt is the url so it will be 'http://www.view.com/view/pdfs/view.pdf'

 

The function:

function openLink(url){ 
	var args = new blackberry.invoke.BrowserArguments(url);
	blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
}

 

I have also added in the config.xml

<feature id="blackberry.identity" />
<feature id="blackberry.invoke" />
<feature id="blackberry.invoke.BrowserArguments" />

 

Can anyone please advise on this?

 

TQ!

 

Please use plain text.
BlackBerry Development Advisor (Retired)
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: How to View Pdf on Browser

Which platform (BB10, Tablet OS, BBOS) and device are you testing on?

 

In most cases, the experience will be to prompt you to download or open the document.  In some cases, the PDF reader application may then be opened to display the document.

 

I believe only BBOS 5.0 and earlier supported PDF-in-the browser because the connected back-end service transcoded the PDF document into content readable by the browser.

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
Regular Contributor
iruka
Posts: 79
Registered: ‎09-17-2012
My Device: Torch 9800
My Carrier: DiGi

Re: How to View Pdf on Browser

I am testing on 9900 running on OS 7.1.

 

The user of the app would like to view attachment and not save it to the device. So when they click on the link it will prompt to save and they have to  switch application to Pdf To Go to view the downloaded pdf.

 

Is there any way to allow Pdf To Go automatically launch when user view pdf attachment? 

Please use plain text.
New Contributor
lemieuxbedard
Posts: 6
Registered: ‎03-19-2013
My Device: Playbook
My Carrier: Rogers

Re: How to View Pdf on Browser

I got the same problem with the black berry playbook os to open pdf from my web app.

 

Here is my post:

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/How-can-i-access-to-my-app-file-...

 

I tried also embed and object:

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/PlayBook-WebWorks-and-HTML-embed...

 

 

Please use plain text.