Customizing JPedal
JPedal now includes the ability to customise certain parameters by passing values into the software.
This is achived with a PdfDecoder method modifyJPedalParameters(Map values).
How does it work?
The example code below gives examples of how to use this function and a full list of valid settings. It should be called before any files are opened.
Map mapValues=new HashMap();
mapValues.put(JPedalSettings.DISPLAY_INVISIBLE_TEXT,Boolean.TRUE);
mapValues.put(JPedalSettings.TEXT_HIGHLIGHT_COLOUR, Color.GREEN);
mapValues.put(JPedalSettings.CACHE_LARGE_FONTS,new Integer(65536));
//exception will be thrown if invalid value passed
PdfDecoder.modifyJPedalParameters(mapValues);
Valid settings
See also org.jpedal.constants.JPedalSettings
| Parameter | Valid values | Version added | Notes on usage |
| DISPLAY_INVISIBLE _TEXT |
Boolean.TRUE or Boolean.FALSE | 3.21b27 | Show text which is extractable but not usually shown . |
| TEXT_HIGHLIGHT _COLOUR |
Any Color | 3.21b27 | Set highlight colour used (default is blue). |
| TEXT_INVERTED _COLOUR |
Any Color | 3.41b26 | Usually text of highlights is inverted normal text color (so black text is drawn white when highlighted). If this value is set it will be hard-coded. |
| CACHE_LARGE_FONTS | Any number as an Integer | 3.22b09 | Set size in bytes at which fonts used on systems should be cached (ie avoid loading 100 meg Arial font into memory). Set to -1 to disable. |
| TEXT_PRINT_NON _EMBEDDED_FONTS |
true or false | 3.22b12 | Ensure all non-embedded fonts automatically use String printing TEXTPRINT mode. |
| IGNORE_FORMS_ ON_PRINT |
int[] array | 3.75b25 | Type or Subtype of form object NOT to print for example this code would stop any Form objects of types or subtypes listed being printed subtypes.Click for more details. |
| IMAGE_HIRES | Boolean.TRUE or Boolean.FALSE | 3.50b02 | Flag to enable use of images at the highest quality rather than down-sampling to 100%. This option will use more memory. |
| EXTRACT_AT_BEST _QUALITY |
Boolean.TRUE or Boolean.FALSE | 3.50b10 | Flag to enable extracting pages as images with much improved quality at the cost of greater memory usage (used by HiResThumbnailExtractor example) |
| EXTRACT_AT_BEST _QUALITY_MAXSCALING |
Any positive number as an Integer | 3.70b36 | EXTRACT_AT_BEST_QUALITY can result in some very large files. This parameter allows you to set a maximum value above which the image will not be scaled. If it is set to 3, the image will never be more than 3 times as big.(used by HiResThumbnailExtractor example). |
| EXTRACT_AT_ PAGE_SIZE | String[] containing width and height (ie new String[]{"1000","800"} | 3.70b36 | Set pagesize desired. Aspect ratio will be preserved and JPedal will generate largest image to fit this page size. (used by HiResThumbnailExtractor example). |
| PAGE_SIZE_OVERRIDES _IMAGE |
Boolean.TRUE or Boolean.FALSE | 3.70b36 | Choose which strategy takes priority. (used by HiResThumbnailExtractor example). |
| ALLOW_PAGES_SMALLER _THAN_PAGE_SIZE |
Boolean.TRUE or Boolean.FALSE | 3.84b07 | Flag to enable generating of images smaller than page size on image extraction. |
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




