this page
 source code
PDF2JAD Example
 Sven Menke


The shell script lets you create a J2ME Midlet (.jar and .jad) from a PostScript or PDF source suitable to read on a java enabled smartphone. It needs ghostscript and convert installed and should run on recent linux distros. Once you uploaded the .jad and .jar files to your phone you can start the application which contains every page of your pdf file in the desired sizes. You can navigate back and forth through the pages, select first and last page, change the zoom level, move the field of view on the current page, select between portrait or landscape mode and toggle full screen view.


pdf2jad.sh [options] <filename> <baseout> <size1> [<size2>] [<size3>] [...]
reads the .ps or .pdf file <filename>, renders the pages in sizes <sizeI> (they are assumed to be in increasing order), and writes output to <baseout>.ja{r,d}


-h prints help and exit
-f first page to process
-l last page to process
-z first zoom level to start tiling of images (default=1)


pdf2jad.sh talk.pdf MyTalk 14 56
will create MyTalk.jar and MyTalk.jad containinig all pages of talk.pdf for the resolutions 14 and 56


For some phones the size of the jar file and the size of the png files are limited. On my phone those limits are 1MB and 64k, respectively. If the Midlet is not recognized by your phone or crashes upon opening a page try reducing the resolution and/or decreasing the zoom level for which tiling starts (-z 0) ...