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

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
New Developer
Posts: 6
Registered: ‎10-13-2009
My Device: Not Specified

Download and Open a PDF

Hello all,

 

I have been tasked with writing an application that downloads and opens PDF on a blackberry. I have the downloading part solved. How does one go about determing if the target device can view a PDF? Then how do you switch applications to the PDF viewer to view the file? Or can you the PDF inside your own application with some build in object?

 

 

Thank you,

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Download and Open a PDF

Highlighted
New Developer
Posts: 6
Registered: ‎10-13-2009
My Device: Not Specified

Re: Download and Open a PDF

Yes,

I have read these. (and many like them) It seems odd to me since the blackberry devices have a PDF viewer , but there are no hooks into it like the API like the hooks for the browser. For example from C/C++ i can say System.exec( "open my.pdf" ); Once I download a PDF how can I launch another application and open it. Even if i download a third part PDF browser same problem, how do i launch that program from my code and open the pdf? It seems like the other option is to find some open source Java toolkit.

 

Seems so crazy that a blackberry can view a PDF and you cant just reuse that in any way.

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Download and Open a PDF

If you get the pdf viewer application module name you could try launching it from your application. Check ApplicationManager class.

Use Search. "Accept Solution" If the problem is resolved.
New Developer
Posts: 6
Registered: ‎10-13-2009
My Device: Not Specified

Re: Download and Open a PDF

So ok here is a funny thing

 

When viewing the pdf like this:

 

    BrowserSession browser = Browser.getDefaultSession();
                    browser.displayPage(url);
                    browser.showBrowser();

 

There are no pictures. but when I send the same PDF to my mailbox the blackberry opens its with images.

Can I get the browser to render PDF like the "Open attachment does"

 

I have looked at the application manager,

What is the name of the application that opens the PDF from the mail client?

What is the Module and how can I pass the URL/FileName of the document I wish to open?

 

Developer
Posts: 562
Registered: ‎09-30-2009
My Device: Not Specified

Re: Download and Open a PDF

I believe that's because attachment rendering is done server-side; there's nothing on the client that explicitly does this, I think.

New Developer
Posts: 6
Registered: ‎10-13-2009
My Device: Not Specified

Re: Download and Open a PDF

...I am starting to agree with you. When I open a PDF through email I see the traffic moving back and forth. This leads me to believe that a sever based application is doing conversion and sending JPEG's to the device.

 

BbDeveloper, I would like to try your solution however, I am looking in the ApplicationManager class.

1) what can I do to list all the applications on the device.
--or
2) What is the name of the application that opens PDF

--and--

3)Whar arguments would I have to send to open a file already downloaded to the device.

 

Thank you