Hello,

You can create the pdf and, if the client is under windows, use this code:

 

public void open(String fileName) throws BizException {

        try {

                java.awt.Desktop.getDesktop().open(new File(fileName));

        } catch (IOException ioe) {

                throw new BizException(ioe.toString());

        }

}

 

Jérôme Serré

________________________

Manage your cellar

 <http://www.macave.eu/> Ma cave

 

De : Sandro Martini [mailto:[email protected]] 
Envoyé : jeudi 1 mars 2012 16:58
À : [email protected]
Objet : Re: Pivot pdf viewer

 

Hi,
you could ask the user what to do, maybe ask with a modal dialog if Save the
PDF, or Open it, then close it and proceed.

The Open (show) the PDF is not-so-simple of course ... I'd suggest to try to
wrap PDFRenderer in a Swing application, and execute it.

Quick idea: first try with the Desktop associated action, should be
multi-platform, your "GUI Experience" could not be so integrated, but
probably is it works could be even safer (for example in case of application
crash only the PDF Viewer go down).
Some info here:
http://www.rgagnon.com/javadetails/java-0579.html
http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/desktop
_api/
  -- it hav even a sample application, so you can try without coding ...


Otherwise: take a look at SwingDemo, under Demos, and try to make it work
opening a PDF, it's up to you if in a mixed Swing/Pivot GUI, or if only a
Swing GUI.
In case of problems (you have to try with some different PDF, even big, and
possibly even from different sources (generated in different ways and with
different tools), try to convert the PDF into an image (using conversions
available in many pdf libraries for Java).

Then, verify in your application if it's better to have the PDF Viewer as
external app (first case), or swing, or mixed swing/pivot, and chose a
deploy option for it (in any case I'd keep its jar different from the rest
of your app).
And see if it's better to execute it as another process (external, or even a
Java process), or directly inside your app.


Tell me what you think ... and keep us updated.


Bye

Reply via email to