ICEpdf
  1. ICEpdf
  2. PDF-1276

handling of custom properties

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.3.1
    • Fix Version/s: 6.3.2
    • Component/s: Viewer RI
    • Labels:
      None
    • Environment:
      Windows

      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);

        Activity

        Hide
        Patrick Corless added a comment -

        Marking as fixed.

        Show
        Patrick Corless added a comment - Marking as fixed.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Stefan Franz
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: