JavaME PDF reader - Quick start
This simple tutorial shows you how to use JavaME to view a PDF in the Netbeans phone emulator.
How to add a JavaME PDF viewer to your code
If you have followed the previous tutorials to set up a Netbeans project and have checked the correct jars are on your classpath it is really simple to start using the viewer.
Firstly your need a PDF file to look at. Put it in the directory on your hardrive that represents the emulated phones filesystem (Theres an example PDF you can use here).
The filesystem is in c:\Users\<UserName>\javame-sdk\3.0\work\10 on my machine, but you can check yours by simply putting the follow line of code in the main method and clicking run:
System.out.println(System.getProperty("user.dir"));
The Netbeans output window will show the path to the phones filesystem and you should put the PDFs you want to view in there.
Now all you have to do is make an instance of the MEViewer object and call its init method with the PDF you want to see. Just replace the contents of the main method with these 2 lines:
MEViewer viewer = new MEViewer();
viewer.init("JPedal.pdf");
Click on the lightbulb to add the import from:
import org.jpedal.examples.meviewer.MEViewer
Press run and there you go, a JavaME PDF viewer that you can put into your own code.
Feedback, questions and updates
There is a support forum for questions, or you can contact IDRsolutions via our contact page.
There is an RSS feed with regular updates about our products. We recommend you subscribe so we can keep you updated.
Please let us know if you find any bugs with the bug report form.
Return to main PDF support section
Click here for the main PDF support area with lots of java examples, PDF tutorials and useful information to get the most out of the JPedal PDF library









