voyent
Avoiding user setting popup  XML
Forum Index -> ICEpdf General
Author Message
LarsD

Joined: 13/Jun/2016 05:43:38
Messages: 5
Offline


Hello everybody,

I'm using version 6.1.1 of ICEPdf Viewer in a Java application.

The viewer works fine so far but before opening a PDF it aks if I'm willing to create a folder in my windows user directory to save viewer settings in it.

Can I avoid this? May be just a setting to say allways yes or no.

Thanks in advance.

Lars
ken.fyten

Joined: 26/Oct/2004 00:00:00
Messages: 1341
Online


Hi,

Yes, you can use the "application.showLocalStorageDialogs='false'" configuration property to avoid displaying this popup.

See http://www.icesoft.org/wiki/display/PDF/Customizing+the+Viewer for more information.

Regards,
Ken

Ken Fyten
VP Product Development
ICEsoft Technologies, Inc.
LarsD

Joined: 13/Jun/2016 05:43:38
Messages: 5
Offline


Hi Ken,

thanks for your reply.

If was working with these properties before, but I did not noticed that one because it is not available as public key in the org.icepdf.ri.util.PropertiesManager. Is there a special reason for that?

Also, if the property disables the popup in the UI... Does the application save user settings or not?

kind regards
Lars
ken.fyten

Joined: 26/Oct/2004 00:00:00
Messages: 1341
Online


Hi,

Actually, it is in the PropertiesManager.java class, line 292 I believe.

If you don't show the dialog then no properties file will be created, so an user settings and state will be lost upon shutdown.

Regards,
Ken

Ken Fyten
VP Product Development
ICEsoft Technologies, Inc.
LarsD

Joined: 13/Jun/2016 05:43:38
Messages: 5
Offline


Hi Ken,

I checked the sources. Yes, the parameter is used in the code but it is not available as public static key.

So I have to use it like this:
Code:
Properties.setBoolean(PropertiesManager.PROPERTY_SHOW_UTILITY_SAVE, Boolean.TRUE);
 lProperties.setBoolean(PropertiesManager.PROPERTY_SHOW_UTILITY_SEARCH, Boolean.FALSE);
 lProperties.setBoolean(PropertiesManager.PROPERTY_SHOW_UTILITY_UPANE, Boolean.FALSE);
 lProperties.setBoolean("application.showLocalStorageDialogs", Boolean.FALSE);
 


I will check if it works.

kind regards
Lars
LarsD

Joined: 13/Jun/2016 05:43:38
Messages: 5
Offline


Hello,

I used the property as described below. It does not work :(

All other properties do work.

I also updated to version 6.1.2 to avoid any version problems.

Any ideas?

kind regards
Lars

ken.fyten

Joined: 26/Oct/2004 00:00:00
Messages: 1341
Online


Hi,

Have you tried changing the "application.showLocalStorageDialogs = yes
" value to "no" in the /icepdf/ri/viewer/res/ICEpdfDefault.properties file?

Regards,
Ken

Ken Fyten
VP Product Development
ICEsoft Technologies, Inc.
patrick.corless

Joined: 26/Oct/2004 00:00:00
Messages: 1982
Offline


The code you posted should work as is but here is how to set the value via a string assignment. Also make sure you pass the properties file when creating a new SwingViewBuilder.

Code:
 PropertiesManager properties = new PropertiesManager(System.getProperties(),
                         ResourceBundle.getBundle(PropertiesManager.DEFAULT_MESSAGE_BUNDLE));
 properties.set(PropertiesManager.PROPERTY_SHOW_TOOLBAR_FORMS, "false");
 properties.set("application.showLocalStorageDialogs", "false");
 
 SwingController swingController = new SwingController();
 swingController.setIsEmbeddedComponent(true);
 
 SwingViewBuilder factory = new SwingViewBuilder(swingController, properties);
 JPanel viewerPanel = factory.buildViewerPanel();
[Email]
LarsD

Joined: 13/Jun/2016 05:43:38
Messages: 5
Offline


Hello,

this is the code i use:
Code:
 final SwingController lController = new SwingController();
 
 final PropertiesManager lProperties = new PropertiesManager(System.getProperties(), ResourceBundle.getBundle(PropertiesManager.DEFAULT_MESSAGE_BUNDLE));    lProperties.set(PropertiesManager.PROPERTY_SHOW_TOOLBAR_ANNOTATION, FALSE);
     lProperties.set(PropertiesManager.PROPERTY_SHOW_TOOLBAR_FIT, FALSE);
     lProperties.set(PropertiesManager.PROPERTY_SHOW_TOOLBAR_FORMS, FALSE);
     lProperties.set(PropertiesManager.PROPERTY_SHOW_TOOLBAR_PAGENAV, TRUE);
     lProperties.set(PropertiesManager.PROPERTY_SHOW_TOOLBAR_ROTATE, FALSE);
     lProperties.set(PropertiesManager.PROPERTY_SHOW_TOOLBAR_TOOL, FALSE);
     lProperties.set(PropertiesManager.PROPERTY_SHOW_TOOLBAR_UTILITY, TRUE);
     lProperties.set(PropertiesManager.PROPERTY_SHOW_TOOLBAR_ZOOM, TRUE);
     lProperties.set(PropertiesManager.PROPERTY_SHOW_UTILITY_PRINT, TRUE);
     lProperties.set(PropertiesManager.PROPERTY_SHOW_UTILITY_OPEN, TRUE);
     lProperties.set(PropertiesManager.PROPERTY_SHOW_UTILITY_SAVE, TRUE);
     lProperties.set(PropertiesManager.PROPERTY_SHOW_UTILITY_SEARCH, FALSE);
     lProperties.set(PropertiesManager.PROPERTY_SHOW_UTILITY_UPANE, FALSE);
     lProperties.set("application.showLocalStorageDialogs", FALSE);
     final SwingViewBuilder lFactory = new SwingViewBuilder(lController, lProperties);
 


I tried it with setBoolean(String, Boolean) and set(String, String).

All Properties a working but the PopUp is still coming up when the ICEPdf Viewer is loading.

kind regards,
Lars
ibrahim.cavdar

Joined: 07/Feb/2021 23:30:33
Messages: 1
Offline


I am quoting a reply from another post for anyone seeing this post in the future but not the other post that has the answer


patrick.corless wrote:
The "application.showLocalStorageDialog" property needs to be set before the PropertiesManager is created either by setting it as a system property or passing it in as a default property set. The following code should help you out.

Code:
 Properties myProperties = new Properties();
 myProperties.setProperty("application.showLocalStorageDialogs", "false");
 
 PropertiesManager properties = new PropertiesManager(
         System.getProperties(), myProperties,
         ResourceBundle.getBundle(PropertiesManager.DEFAULT_MESSAGE_BUNDLE));
 
 
Forum Index -> ICEpdf General
Go to:   
Powered by JForum 2.1.7ice © JForum Team