greeeat! tha was just i need...

Cordialmente,

[cid:[email protected]]

Camilo Casadiego Espitia
Arquitecto de SW
* + 57 1 6393000
* [email protected]<mailto:[email protected]>
* http://www.adv.com.co<http://www.adv.com.co/>
Carrera 11 No. 93 - 53 P7
Bogotá - Colombia



De: Jérôme Serré [mailto:[email protected]]
Enviado el: Thursday, March 01, 2012 11:04 AM
Para: [email protected]
Asunto: RE: Pivot pdf viewer

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
Ma cave<http://www.macave.eu/>

De : Sandro Martini [mailto:[email protected]]
Envoyé : jeudi 1 mars 2012 16:58
À : [email protected]<mailto:[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

<<inline: image001.png>>

Reply via email to