JVM flags

JPedal includes a number of flags which can be added to the java command line to alter the way it operates. These are listed in the tables below. The values are all lower case.

For example, the command:

java -Dorg.jpedal.jai=true -cp jpedal.jar org/jpedal/examples/viewer/Viewer

will run JPedal using JAI (if available) to speed-up image scaling operations.

You can also set the values using System.setProperties() in Java but you must do this before accessing JPedal.

 

General JVM flags in JPedal

Flag Description of JVM function Example usage
org.jpedal. avoidCleanupRaster=”true” Tells JPedal to avoid reducing some large images as this can crash Java -Dorg.jpedal.avoidCleanupRaster=”true”
org.jpedal.fontdirs Tells JPedal to register fonts on these directories and use fonts for unembedded fonts in PDF. It expects a comma separated list (directories do not need to exist so it is useful for cross-platform settings). -Dorg.jpedal.fontdirs= “C:/win/fonts, /usr/etc/X11/fonts/”
org.jpedal. useTTFontHinting (Added in 4.20) Tells JPedal to use Truetype font hinting. Default is false as some fonts contain instructions on which Apple has a patent. -Dorg.jpedal.useTTFontHinting= “true”
org.jpedal.memory Downsamples images to save memory. -Dorg.jpedal.memory =true
org.jpedal.hires Maintains images at highest resolution. -Dorg.jpedal.hires =true
org.jpedal.jai Instructs JPedal to use JAI library if on classpath. -Dorg.jpedal.jai =true
JAI itself has a flag to turn off hardware acceleration (removing the time-consuming check) com.sun.media.jai.disableMediaLib
org.jpedal. securityprovider Instructs JPedal to use an alternative Security library for encryption. -Dorg.jpedal. securityprovider= “org.bouncycastle.jce. provider. BouncyCastleProvider”
org.jpedal. CMYKprofile Instructs JPedal to use a different ICC profile (file ends .icm) from default for CMYK . -Dorg.jpedal.CMYKprofile= “C:/altProfile.icm”
org.jpedal. RGBprofile Instructs JPedal to use a different ICC profile (file ends .icm) from default for sRGB . -Dorg.jpedal.RGBprofile= “C:/altProfile.icm”
org.jpedal. downsample New downsampling class org.jpedal.images.SamplingFactory offers several options to improve memory usage and speed on PDFs with large images.  This value can also be set programmatically. -Dorg.jpedal.downsample= “high”
org.jpedal. noURLaccess Stop any URL from opening in browser. It also disables any tooltips. Settings are true, false or any message to display (which also stops access) -Dorg.jpedal.noURLaccess = “We have disabled URL links”
org.jpedal. fasterPNG Remove safety checks and write out as Indexed PNG. -Dorg.jpedal.fasterPNG=true
org.jpedal.flattenForm Flattens out all the Forms, putting them on the page display, but No interactivity. -Dorg.jpedal.flattenForm=true
org.jpedal.inclusiveLogFilters Only shows the messages which contain the values given by the flag. The values are given as comma-seperated values. -Dorg.jpedal.inclusiveLogFilter= “memory,error,jai”

Extra flags in examples

Flag Example Description of Usage Example Use
org.jpedal. logging ExtractClippedImages Write to logfile -Dorg.jpedal. logging =true
org.jpedal. compress_jpeg ConvertPagesToHiResImages, ConvertPagesToImages (Added in 3.90) If JAI available, use it to write out JPeg files with user setting for JPEG compression quality (0= very samll, poor files, 1= very large files with no compression) -Dorg.jpedal. compress_jpeg =0.5
org.jpedal. compress_tiff ExtractClippedImages, ExtractImages, ConvertPagesToImages If JAI available, use it to write out Tiff files compressed -Dorg.jpedal. compress_tiff =true
org.jpedal.
multipage_tiff
ConvertPagesToImages If JAI available, use it to write out all images to one Tiff file -Dorg.jpedal.multipage_tiff=true
org.jpedal. jpeg_dpi ExtractClippedImages, ExtractImages, ConvertPagesToImages If JAI available, use it to write out Tiff files compressed -Dorg.jpedal. jpeg_dpi =true
org.jpedal. opi ExtractImages Include OPI metadata in XML information with images -Dorg.jpedal.opi =true
org.jpedal. listenforms Viewer Enable custom example listener on forms components -Dorg.jpedal. listenforms =true
org.jpedal. startWindowSize Viewer (From 3.77b28) the startup size of the Viewer can be set on startup with value width x height -Dorg.jpedal. startWindowSize= 400×300
org.jpedal. page Viewer Page number to open document, if valid. -Dorg.jpedal. page =4
org.jpedal. bookmark Viewer Location to open document (either a bookmark or named destination), if valid. -Dorg.jpedal. bookmark =into
org.jpedal. thumbnail Viewer Flag to disable thumbnails. Default is on. -Dorg.jpedal.thumbnail=false
org.jpedal. configureViewer Viewer Flag to disable menu options from config file. See this link for details. -Dorg.jpedal. configureViewer=config.txt
org.jpedal. password

Viewer Password to open file – set to null if not needed -Dorg.jpedal. password =”mypassword”
org.jpedal. Viewer.Prefs Viewer Location of Properties file to be used when opening Viewer -Dorg.jpedal. Viewer.Prefs =”C:prop.xml”
org.jpedal. defaultViewerScaling Viewer Flag to enable user to startup with a specific scaling value (ie Fit Width, 25, 100, Fit Height). Value must be on scaling list or will be ignored. -Dorg.jpedal.defaultViewerScaling =”Fit Width”
org.jpedal. suppressViewerPopups Viewer Flag to enable user to suppress all popups at start. -Dorg.jpedal.suppressViewerPopups =true
org.jpedal.pageSize ConvertPagesToHiResImages Set pagesize to scale up to (preserving aspect ratio). Values are width x height -Dorg.jpedal. pageSize =”1000×800″
org.jpedal. pageMaxScaling ConvertPagesToHiResImages Set maximum scaling allowed so rogue image does not cause hugh images -Dorg.jpedal. pageMaxScaling =4
org.jpedal. pageSizeOverrides
ConvertPagesToHiResImages Set whether pageSize or image scaling takes priority -Dorg.jpedal. pageSizeOverrides =”true”
org.jpedal. defaultPrinter
PrintPanel Set default printer to be used by JPedal -Dorg.jpedal. defaultPrinter =”Adobe PDF”
org.jpedal. printPaperSize
PrintPanel Set default paper size to print on -Dorg.jpedal. printPaperSize =”A4 (borderless)”
org.jpedal. separation
ConvertPagesToHiResImages/ ConvertPagesToImages Create multiple images with separate image, text and Vector content on each. Click here for details. -Dorg.jpedal. separation =”all”
org.jpedal. imageType
ConvertPagesToHiResImages/ ConvertPagesToImages Set color type and color depth of the image to be saved out using a TYPE variable from a awt BufferedImage. -Dorg.jpedal. imageType =2