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.flattenForm=true -jar jpedal.jar $InputFile $OutputDirectory Flattens out all the Forms, putting them on the page display, but No interactivity. You can also set the values using System.setProperties() in Java but you must do this before accessing JPedal.
List of JVM flags in JPedal
- General JVM Flags
- Extra Flags For Specific Features
- org.jpedal.compress_tiff
- org.jpedal.multipage_tiff
- org.jpedal.opi
- org.jpedal.startWindowSize
- org.jpedal.page
- org.jpedal.bookmark
- org.jpedal.thumbnail
- org.jpedal.password
- org.jpedal.Viewer.Prefs
- org.jpedal.defaultViewerScaling
- org.jpedal.suppressViewerPopups
- org.jpedal.userControlledLAF
- org.jpedal.pageSize
- org.jpedal.pageMaxScaling
- org.jpedal.pageSizeOverridesImage
- org.jpedal.defaultPrinter
- org.jpedal.printPaperSize
- org.jpedal.separation
- org.jpedal.imageType
- org.jpedal.targetRelativeLinkDir
- org.jpedal.offsetclips
- image.tiff.compression
- image.tiff.dpi
- JPedalSettings
- JPedalSettings.CACHE_LARGE_FONTS
- JPedalSettings.DISPLAY_INVISIBLE_TEXT
- JPedalSettings.TEXT_PRINT_NON_EMBEDDED_FONTS
- JPedalSettings.TEXT_INVERTED_COLOUR
- JPedalSettings.PAGE_SIZE_OVERRIDES_IMAGE
- JPedalSettings.IGNORE_FORMS_ON_PRINT
- JPedalSettings.UNDRAWN_PAGE_COLOR
- JPedalSettings.REPLACEMENT_COLOR_THRESHOLD
- JPedalSettings.USE_INT_PAGE_SIZE_FOR_SCALING
- JPedalSettings.USE_SOFTCLIP_FOR_SHAPES
- JPedalSettings.OFF_SCREEN_RENDERING
- JPedalSettings.USE_CONVOLUTION
- JPedalSettings.USE_SOFTCLIP_FOR_IMAGES
- JPedalSettings.FULL_OFF_SCREEN_RENDERING
General JVM Flags
org.jpedal.fontdirs
Tells JPedal to register additional fonts from a list of directories and use these fonts for non-embedded fonts in PDF. These directories do not need to exist so it is useful for cross-platform settings.
Accepted Values
Comma separated list of directories.
org.jpedal.useTTFontHinting
Tells JPedal to use TrueType font hinting. Default is false as some fonts contain instructions on which Apple has a patent.
Accepted Values
- true
- false
org.jpedal.securityprovider
Instructs JPedal to use an alternative Security library for encryption. This should be the full class name delimited with ‘.’ between package and class names.
Accepted Values
String class name for the providers class.
org.jpedal.RGBprofile
Instructs JPedal to use a different ICC profile from default for sRGB .
Accepted Values
The absolute filename for a .icm file.
org.jpedal.downsample
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.
Accepted Values
- high
- medium
- none
- print_disable
- print_enable
Default
high
org.jpedal.noURLaccess
Stop any URL from opening in browser. It also disables any tooltips on links.
Accepted Values
- true
- false
- Any message you wish to display (appears in a dialog box).
Default
false
org.jpedal.flattenForm
Flattens out all the Forms, putting them on the page display, but with no interactivity.
Accepted Values
- true
- false
Default
false
org.jpedal.inclusiveLogFilters
Only shows log messages which contain the values given by the flag. The values are given as comma-separated values.
Accepted Values
Comma separated list of values to check for in log messages.
org.jpedal.updateFileOnClose
Saves any changes to a file automatically when the viewer is closed.
Accepted Values
- true
- false
Default
false
Extra Flags For Specific Features
org.jpedal.compress_tiff
Write out Tiff files compressed.
Features using this flag
- ExtractClippedImages
- ExtractImages
- ConvertPagesToImages
Accepted Values
- true
- false
Default
false
org.jpedal.multipage_tiff
Write out all images to one Tiff file.
Features using this flag
- ConvertPagesToImages
Accepted Values
- true
- false
Default
false
org.jpedal.opi
Include OPI metadata in XML information with images.
Features using this flag
- ExtractImages
Accepted Values
- true
- false
Default
false
org.jpedal.startWindowSize
Set the initial size of the Viewer.
Features using this flag
- Viewer
Accepted Values
A string containing width and height following the pattern WIDTHxHEIGHT. e.g 400x300
org.jpedal.page
Page number to open document, if page exists.
Features using this flag
- Viewer
Accepted Values
Any page number.
Default
1
org.jpedal.bookmark
Location to open document (either a bookmark or named destination), if valid.
Features using this flag
- Viewer
Accepted Values
The name of a destination or bookmark in the file being opened.
org.jpedal.thumbnail
Flag to disable thumbnails appearing in the Viewer.
Features using this flag
- Viewer
Accepted Values
- true
- false
Default
true
org.jpedal.password
Set a password to be used to open password protected files. If this password does not match you will asked to enter a password.
Features using this flag
- Viewer
Accepted Values
Any string
Default
No password provided, you will be asked to enter one.
org.jpedal.Viewer.Prefs
Flag to allow you to load a specific preferences file that controls which menus items are present among other things. See this tutorial for more details.
Features using this flag
- Viewer
Accepted Values
The filename of the preferences file you wish to use.
org.jpedal.defaultViewerScaling
Flag to enable user to startup with a specific scaling value from the scaling options in the Viewers scaling combo box.
Features using this flag
- Viewer
Accepted Values
- Fit Page
- Fit Height
- Fit Width
- 25
- 50
- 75
- 100
- 125
- 150
- 200
- 250
- 500
- 750
- 1000
Default
Fit Page
org.jpedal.suppressViewerPopups
Flag to enable user to suppress all popups when viewer first starts.
Features using this flag
- Viewer
Accepted Values
- true
- false
Default
false
org.jpedal.userControlledLAF
This flag grants the user control over the look and feel used by the JPedal Viewer. This flag can have 3 different input values. This should be the full class name delimited with ‘.’ between package and class names.
Features using this flag
- Viewer
Accepted Values
- true
Viewer will not set a look and feel, instead using the currently set Look and Feel. - false
Viewer will set up a look and feel based on the current preferences values (System look and feel by default). - class name of a java look and feel
Viewer will set up the specified look and feel.
Default
false
org.jpedal.pageSize
Set pagesize to scale the PDF page up to (preserving aspect ratio).
Features using this flag
- ConvertPagesToHiResImages
Accepted Values
A string containing width and height following the pattern WIDTHxHEIGHT. e.g 400x300
org.jpedal.pageMaxScaling
Set maximum scaling allowed. This can help to prevent any images becoming too large.
Features using this flag
- ConvertPagesToHiResImages
Accepted Values
Any float value (where 1 = 100% scaling).
Default
No max scaling specified.
org.jpedal.pageSizeOverridesImage
Set whether pageSize or max page scaling takes priority.
Features using this flag
- ConvertPagesToHiResImages
Accepted Values
- true
- false
Default
false
org.jpedal.defaultPrinter
Set default printer to be used by JPedal.
Features using this flag
- PrintPanel
Accepted Values
The name of an available printer.
Default
The systems default printer.
org.jpedal.printPaperSize
Set default paper size to print on.
Features using this flag
- PrintPanel
Accepted Values
The name of a paper size supported by the printer.
Default
The printers default paper size.
org.jpedal.separation
Create multiple images with separate image, text and Vector content on each. Find out more details.
Features using this flag
- ConvertPagesToHiResImages
- ConvertPagesToImages
Accepted Values
all
org.jpedal.imageType
Set colour type and colour depth of the image to be saved out using a TYPE variable from an awt BufferedImage.
Features using this flag
- ConvertPagesToHiResImages
- ConvertPagesToImages
Accepted Values
Any value from 1 to 13 based on BufferedImage type.
org.jpedal.targetRelativeLinkDir
The directory to use as the relative directory for link annotations.
Accepted Values
Absolute path of the desired directory.
Default
The directory the pdf currently open is located in.
org.jpedal.offsetclips
The amount of pixels to offset image clips by in pdf to image conversions.
This can be used to remove thin white lines in images.
Accepted Values Any positive decimal value.
A value of 0.3 is recommended for a good balance between removing thin white lines and limiting unintended differences.
Default
0
image.tiff.compression
You can provide the compression you’d like to be applied to the image when written out as TIFF. See TiffCompressionFormat for more info.
Accepted Values
- deflate
- deflate_better_compression
- deflate_better_speed
- jpeg
- lzw
- none
Default
deflate
image.tiff.dpi
You can provide the DPI to set for the image when written out as TIFF.
Accepted Values Any positive number
Default
Not set
JPedalSettings
Unlike the JVM flags above, the settings below are not set on the Java command line or with System.setProperties(). They are set programmatically using a Map<Integer, Object> of key/value pairs passed to PdfDecoder.modifyNonstaticJPedalParameters(Map), where the key is a constant from org.jpedal.constants.JPedalSettings and the value depends on the setting.
final Map<Integer, Object> parameters = new HashMap<>();
parameters.put(JPedalSettings.CACHE_LARGE_FONTS, Boolean.TRUE);
parameters.put(JPedalSettings.PAGE_COLOR, Color.WHITE.getRGB());
final PdfDecoder decodePdf = new PdfDecoder();
decodePdf.modifyNonstaticJPedalParameters(parameters);
Each setting below states which JPedal features it applies to, and is only relevant when that feature is in use (the Viewer, printing, or converting to image).
JPedalSettings.CACHE_LARGE_FONTS
For use with all JPedal functionality. Allows JPedal to cache large fonts to avoid a large memory hit.
Accepted Values
- Boolean.TRUE
- Boolean.FALSE
JPedalSettings.DISPLAY_INVISIBLE_TEXT
For use with the Viewer, printing, and converting to image. Allows JPedal to display invisible text in the current fill color.
Accepted Values
- Boolean.TRUE
- Boolean.FALSE
JPedalSettings.TEXT_PRINT_NON_EMBEDDED_FONTS
For use with printing. Allows JPedal to print all text fonts using Java’s own text printing, rather than JPedal’s renderer.
Accepted Values
- Boolean.TRUE
- Boolean.FALSE
JPedalSettings.TEXT_INVERTED_COLOUR
For use with the Viewer. Sets a color to be used for text when it is highlighted.
Accepted Values
An Integer RGB color value, such as one returned by Color.getRGB().
JPedalSettings.PAGE_SIZE_OVERRIDES_IMAGE
For use with converting to image. Tells JPedal to use JPedalSettings.EXTRACT_AT_PAGE_SIZE instead of JPedalSettings.EXTRACT_AT_BEST_QUALITY_MAXSCALING.
Accepted Values
- Boolean.TRUE
- Boolean.FALSE
This is the programmatic equivalent of the
org.jpedal.pageSizeOverridesImageJVM flag above. Use this setting instead if you are configuringConvertPagesToHiResImagesin code rather than on the command line.
JPedalSettings.IGNORE_FORMS_ON_PRINT
For use with printing. Allows JPedal to ignore the specified form types and subtypes when printing a PDF.
Accepted Values
The Javadoc does not specify the exact value format for this setting. Contact us if you need to use this setting.
JPedalSettings.UNDRAWN_PAGE_COLOR
For use with the Viewer. Sets the color used for a page area that has not been rendered yet.
Accepted Values
An Integer RGB color value, such as one returned by Color.getRGB().
JPedalSettings.REPLACEMENT_COLOR_THRESHOLD
For use with the Viewer, printing, and converting to image. Allows JPedal to only replace text color if the color values go beyond a given threshold. This value only has meaning if JPedalSettings.TEXT_COLOR has also been set.
Accepted Values
A numeric threshold value. The Javadoc does not specify the exact range for this setting.
JPedalSettings.USE_INT_PAGE_SIZE_FOR_SCALING
For use with the Viewer, printing, and converting to image. Allows JPedal to use int instead of float values for page sizes, which can give better scaling on some PDF files.
Accepted Values
- Boolean.TRUE
- Boolean.FALSE
JPedalSettings.USE_SOFTCLIP_FOR_SHAPES
For use with the Viewer, printing, and converting to image. Allows JPedal to use soft-clipping when rendering shapes. Hard clipping clips a shape where whole pixels are either in or out of the clip; this is how Java clips by default. Soft clipping allows the boundary pixels’ alpha to be adjusted based on the portion in the clip, giving the clipped shapes a smoother, less jagged, edge.
Accepted Values
- Boolean.TRUE
- Boolean.FALSE
JPedalSettings.OFF_SCREEN_RENDERING
For use with the Viewer. Allows JPedal to use off-screen rendering techniques to improve rendering performance in the Viewer. This can improve performance when using features such as text highlighting that update the display without altering the portion of the page displayed.
Accepted Values
- Boolean.TRUE
- Boolean.FALSE
If you are using the JPedal Viewer, you can set this from its properties file or preferences window instead, see Use Off-Screen Rendering.
JPedalSettings.USE_CONVOLUTION
For use with the Viewer, printing, and converting to image. Allows JPedal to use convolution in image scaling to improve its final appearance.
Accepted Values
- Boolean.TRUE
- Boolean.FALSE
JPedalSettings.USE_SOFTCLIP_FOR_IMAGES
For use with the Viewer, printing, and converting to image. Allows JPedal to use soft-clipping when rendering images. See JPedalSettings.USE_SOFTCLIP_FOR_SHAPES above for an explanation of soft-clipping.
Accepted Values
- Boolean.TRUE
- Boolean.FALSE
JPedalSettings.FULL_OFF_SCREEN_RENDERING
For use with the Viewer. Allows JPedal to render the full page off-screen, which improves the performance of off-screen rendering but increases memory consumption. This functions as JPedalSettings.OFF_SCREEN_RENDERING above, but stores the entire page in memory rather than just the visible area.
Accepted Values
- Boolean.TRUE
- Boolean.FALSE
If you are using the JPedal Viewer, you can set this from its properties file or preferences window instead, see Use Full Offscreen Rendering.