ICE PDF | How to deploy and use with print option

1.4k views Asked by At

I am using icepdf - opensource java application for pdf viewer in my web. ICEPDF works fine for me (I can view pdf using this) but now I want to add print option to this. Is this possible. Is there any war file for this so that I will deploy it in tomcat.

2

There are 2 answers

1
pcorless On

If your using the viewer as an Applet then you can use the "print" button on the toolbar to print. If your using the ICEfaces webapp example or a variant of it then printing will be difficult via the browser. The Servlet responsible for rendering a PDF page render a page at a time. In order to print the whole document all pages in the document would have to be rendered to the browser before a print could be initiated.

Other PDF viewer web apps often push the print command off to a client side Applet or some native PDF viewer.

0
pcorless On

The PropertyManager class can be used to configure the UI. Create a new instance, set the desired overrides and pass pass it into the SwingViewBuilder constructor.

SwingController controller = new SwingController(); 

PropertiesManager properties =
    new PropertiesManager(System.getProperties(),
            ResourceBundle.getBundle(PropertiesManager.DEFAULT_MESSAGE_BUNDLE));

properties.setBoolean(PropertiesManager.PROPERTY_SHOW_UTILITY_SAVE,
            Boolean.FALSE);

SwingViewBuilder factory = new SwingViewBuilder(controller, properties);