by David K. Levine
Background image files can be loaded, either to serve as a
decorative background, or for purposes of annotation.
A background image file can contain a single or multiple images. Files containing multiple images include a zip file containing single image files, multi-page tiff files, and pdf files. Multiple background files are supported. Opening a background file has one of two effects depending on whether the current page has a visible background or not. If the background is visible, the opened file replaces the existing background. If the background is not visible, the opened file is added to the existing backgrounds, the current page is assigned the first page of the background and pages are added for the remaining pages of the background. Backgrounds may either be repeating or non-repeating. With repeating backgrounds, additional pages beyond the end of the background repeat the original background. By default single image files are repeating, multi-image files are not.
You can toggle background images on and off on a per page basis from the paper menu. You may either use external background files, with the path to the background file stored in the jarnal file, so that when the file is reopened so will the background images (if they haven't been moved), or you may store the backgrounds directly in the .jaj file. If you are collaborating, and your collaborators do not have the external file in the same location in the file system, be sure to choose the store background in file option. You may find annotate.jaj useful as a template for annotation. It sets the paper to plain, size fit to background and transparency to translucent.
A key function of Jarnal is the ability to annotate pdf files. This is done using the JPedal libraries. The libraries consist of two parts - a GPL portion - jpedalt.jar and a proprietary version pjes.jar - that supports embedded fonts. Please be aware that the proprietary part is not released under the GPL and is available for non-commercial use only. For commercial use with Jarnal or for any other commercial use, please purchase the license. I would also like to express my gratitude to Mark Stephens for making the excellent JPedal available under the GPL and pjes.jar freely available for non-commercial use - as well as his patience in helping to get the JPedal libraries to work well with Jarnal.
What types of images are
supported? jpg, png and gif files are always supported. Support
for fax (tiff) and pdf files are optional. Many ways of providing
support are possible. The table below gives the recommended
installation instructions.
fax |
minimum pdf |
maximum pdf |
|
windows |
install the jai |
install jpedal |
windows maximum pdf |
unix including linux, mac |
install the jai |
install jpedal |
unix
maximum pdf |
Sun provides the JAI addon with support for additional graphical formats including multi-page tiff for faxes and ppm files used with xpdf for pdf support on unix systems. For Linux and Windows go to http://java.sun.com/products/java-media/jai/ and download and install JAI for your platform. For the Mac go to http://www.apple.com/downloads/macosx/apple/java3dandjavaadvancedimagingupdate.html. Note: there seem to be two JAI's to install - the connection between them is not clear to me. Make sure to install the "JAI Image I/O API" along with the JAI itself.
Download jpedallib.zip. Find the directory containing your jarnal.jar file. The files in jpedallib.zip should be placed in a subdirectory called lib. Note that jpedallib.zip already has a subdirectory with this name, so make sure the files don't end up in lib/lib. With minimum support installed you will be able to annotate pdf files, view information about the pdf file and you can print to pdf files. You cannot work with text in pdf files.Install Jpedal. Run Jarnal and examine the about box, noting down what it reports your home directory is; under windows it tends to be in an obscure location. Go to that directory and edit the file jarnshell.conf with a text editor. In the line
pdftotext=pdftotext -eol unix -layout -f %1 -l %2 %3 %4
edit it to read
pdftotext=$lib\pdftotext -eol unix -layout -f %1 -l %2 %3 %4
where $lib should be replaced with the path to the lib directory in which you unzipped the jpedal files.
[Instructions that are superceded by the new version of Jpedal. However, you
may still wish to do this if you are having problems with particular pdf files] Go to the ghostscript site and
download and install ghostscript for windows (not ghostview). Run
Jarnal and examine the about box, noting down what it reports your home
directory is; under windows it tends to be in an obscure location. In the line
pdfrenderer=pdftoppm -f %1 -l %2 -r %4 %5 %3
edit it to read
pdfrenderer=$path_to_gs\gswin32c -dNOPAUSE -dBATCH -dTextAlphaBits=4 -dFirstPage=%1 -dLastPage=%2 -sDEVICE=png16m -sOutputFile=%3 -r%4 -f %5
where $path_to_gs should be replaced to the path to the directory that contains the gswin32c executable installed when you installed ghostscript. Important: ghostscript is an external renderer. To use it you must either start jarnal with the -g flag on the command line, or under View | Background Quality make sure that the "Use External Renderer" box is checked.
Unix including Linux and Mac Maximum PDF Support
Install Jpedal. Install the JAI. Install xpdf if it is not already installed. Xpdf ships with most linux distributions, but may not be installed by default. For example, in an rpm based distribution, locate the xpdf rpm and install it. If xpdf is not shipped with your distribution, go to the xpdf website to download and install it. Important: xpdf is an external renderer. To use it you must either start jarnal with the -g flag on the command line, or under View | Background Quality make sure that the "Use External Renderer" box is checked.