It is not possible to open a PDF file on the BlackBerry from within a Java program. Since OS 4.5 (I think) the BlackBerry has a built-in PDF reader but it only works when you receive a PDF file via email. Not even stored PDF files on the sd card can be opened.
So, "no" it is not possible to open a PDF in Java.
Except of course, when you write a PDF reader first.
The BB doesn't have a built-in PDF viewer. You can view PDF attachments in emails, but that works with some server-side magic. I think the best approach is to purchase a 3rd-party viewer and launch that to view the PDF.
Possible viewers include the following. I've not tried any of these yet.
theres nothin native in blackberry to load pdf files, but you can achieve that loading google viewer inside your Browser field, that will do the trick! =D!
public ScrLoad()
{
String url = "http://docs.google.com/gview?embedded=true&url=http://prueba.agenciareforma.com/appiphone/android/elnorte.pdf";
add(new BrowserField(url));
}
I'm not sure about Blackberry exactly, but Java 6 SE has a Desktop class which can be used to open a .pdf file with a program associated with that extension, on that platform.
Try something like this:
if (Desktop.isDesktopSupported()) {
Desktop desktop = Desktop.getDesktop();
if (desktop.isSupported(Desktop.Action.OPEN)) {
File pdf = new File(...); // path to pdf file
try {
desktop.open(pdf);
}
catch (IOException e) {
System.err.println("Could not open " + pdf);
}
}
}
It is not possible to open a PDF file on the BlackBerry from within a Java program. Since OS 4.5 (I think) the BlackBerry has a built-in PDF reader but it only works when you receive a PDF file via email. Not even stored PDF files on the sd card can be opened.
So, "no" it is not possible to open a PDF in Java.
Except of course, when you write a PDF reader first.
The BB doesn't have a built-in PDF viewer. You can view PDF attachments in emails, but that works with some server-side magic. I think the best approach is to purchase a 3rd-party viewer and launch that to view the PDF.
Possible viewers include the following. I've not tried any of these yet.
I think you'd end up using net.rim.device.api.system.ApplicationManager, but I've not tried it yet.
theres nothin native in blackberry to load pdf files, but you can achieve that loading google viewer inside your Browser field, that will do the trick! =D!
Google Docs Viewer http://docs.google.com/gview
I'm not sure about Blackberry exactly, but Java 6 SE has a Desktop class which can be used to open a
.pdf
file with a program associated with that extension, on that platform.Try something like this: