Details
Description
After initialyzing ICEpdf with a custom zoom level the first start of ICEpdf uses the right zoom level. Any later call of that viewer instance resets zooms level or other properties to default. In versions before 6.3 everything works fine.
Here is the code:
PropertiesManager props = PropertiesManager.getInstance();
props.clearPreferences();
// PropertiesManager props = new PropertiesManager(System.getProperties(),
// properties, ResourceBundle
// .getBundle(PropertiesManager.DEFAULT_MESSAGE_BUNDLE));
// load font cache to speed up startup time
String[] extraFontPaths = new String[] { System.getenv("windir")
+ "\\fonts\\" };
FontManager fontManager = FontManager.getInstance();
fontManager.readSystemFonts(extraFontPaths);
_logger.info("Viewer: Zoom-Werte werden gesetzt...");
// Einstellung der Zoom-Groesse aus den PuR-Eigenschaften
double dZoom;
try {
int iZoom = RechercheConfigManager.getInstance().getZoomViewer();
if (iZoom == 100) {
dZoom = iZoom * 0.0101;
} else {
dZoom = RechercheConfigManager.getInstance().getZoomViewer() * 0.01;
}
} catch (ValueNotFoundException e) {
dZoom = 1.40;
}
props.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_FORMS, Boolean.FALSE);
props.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_FORMS, Boolean.FALSE);
props.setDouble(PropertiesManager.PROPERTY_DEFAULT_ZOOM_LEVEL, dZoom);
props.setBoolean(PropertiesManager.PROPERTY_SHOW_UTILITYPANE_LAYERS,
Boolean.FALSE);
props.setBoolean(PropertiesManager.PROPERTY_SHOW_UTILITYPANE_BOOKMARKS,
Boolean.FALSE);
props.setDouble(PropertiesManager.PROPERTY_UTILITYPANE_THUMBNAILS_ZOOM,
0.3);
// Annotationen TRUE/FALSE:
props.setBoolean(
PropertiesManager.PROPERTY_SHOW_UTILITYPANE_ANNOTATION,
Boolean.FALSE);
props.setBoolean(PropertiesManager.PROPERTY_SHOW_UTILITY_SAVE,
Boolean.FALSE);
props.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_ANNOTATION,
Boolean.FALSE);
_ICEpdfController.setPropertiesManager(props);
FontPropertiesManager.getInstance().loadOrReadSystemFonts();
// new FontPropertiesManager(props, System.getProperties(), ResourceBundle
// .getBundle(PropertiesManager.DEFAULT_MESSAGE_BUNDLE));
// add interactive mouse link annotation support via callback
_ICEpdfController.getDocumentViewController().setAnnotationCallback(
new org.icepdf.ri.common.MyAnnotationCallback(_ICEpdfController
.getDocumentViewController()));
// Build a SwingViewFactory configured with the controller
SwingViewBuilder _ICEpdfViewBuilder = new MySwingViewBuilder(
_ICEpdfController, props);
Here is the code:
PropertiesManager props = PropertiesManager.getInstance();
props.clearPreferences();
// PropertiesManager props = new PropertiesManager(System.getProperties(),
// properties, ResourceBundle
// .getBundle(PropertiesManager.DEFAULT_MESSAGE_BUNDLE));
// load font cache to speed up startup time
String[] extraFontPaths = new String[] { System.getenv("windir")
+ "\\fonts\\" };
FontManager fontManager = FontManager.getInstance();
fontManager.readSystemFonts(extraFontPaths);
_logger.info("Viewer: Zoom-Werte werden gesetzt...");
// Einstellung der Zoom-Groesse aus den PuR-Eigenschaften
double dZoom;
try {
int iZoom = RechercheConfigManager.getInstance().getZoomViewer();
if (iZoom == 100) {
dZoom = iZoom * 0.0101;
} else {
dZoom = RechercheConfigManager.getInstance().getZoomViewer() * 0.01;
}
} catch (ValueNotFoundException e) {
dZoom = 1.40;
}
props.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_FORMS, Boolean.FALSE);
props.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_FORMS, Boolean.FALSE);
props.setDouble(PropertiesManager.PROPERTY_DEFAULT_ZOOM_LEVEL, dZoom);
props.setBoolean(PropertiesManager.PROPERTY_SHOW_UTILITYPANE_LAYERS,
Boolean.FALSE);
props.setBoolean(PropertiesManager.PROPERTY_SHOW_UTILITYPANE_BOOKMARKS,
Boolean.FALSE);
props.setDouble(PropertiesManager.PROPERTY_UTILITYPANE_THUMBNAILS_ZOOM,
0.3);
// Annotationen TRUE/FALSE:
props.setBoolean(
PropertiesManager.PROPERTY_SHOW_UTILITYPANE_ANNOTATION,
Boolean.FALSE);
props.setBoolean(PropertiesManager.PROPERTY_SHOW_UTILITY_SAVE,
Boolean.FALSE);
props.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_ANNOTATION,
Boolean.FALSE);
_ICEpdfController.setPropertiesManager(props);
FontPropertiesManager.getInstance().loadOrReadSystemFonts();
// new FontPropertiesManager(props, System.getProperties(), ResourceBundle
// .getBundle(PropertiesManager.DEFAULT_MESSAGE_BUNDLE));
// add interactive mouse link annotation support via callback
_ICEpdfController.getDocumentViewController().setAnnotationCallback(
new org.icepdf.ri.common.MyAnnotationCallback(_ICEpdfController
.getDocumentViewController()));
// Build a SwingViewFactory configured with the controller
SwingViewBuilder _ICEpdfViewBuilder = new MySwingViewBuilder(
_ICEpdfController, props);
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #52855 | Mon Dec 17 21:08:00 MST 2018 | patrick.corless | saved but only Strings can be Retrieved. Touched out propertiesManager to be sure we are always setting String values. |
Files Changed | ||||
MODIFY
/icepdf/trunk/icepdf/viewer/viewer-awt/src/main/java/org/icepdf/ri/util/PropertiesManager.java
|