You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Camilo Casadiego <Ca...@adv.co> on 2012/03/01 12:45:11 UTC

Pivot pdf viewer

Hi there, I have a doubt...In the server side of my application I generate a pdf file and then I sent such file to the client through a webservice interface...How can I show this pdf or excel file ebbed into the pivot client


Cordialmente,

[cid:image001.png@01CCF776.D994A1E0]

Camilo Casadiego Espitia
Arquitecto de SW
* + 57 1 6393000
* camilo.casadiego@adv.com.co<ma...@adv.com.co>
* http://www.adv.com.co<http://www.adv.com.co/>
Carrera 11 No. 93 - 53 P7
Bogotá - Colombia




RE: Pivot pdf viewer

Posted by Camilo Casadiego <Ca...@adv.co>.
greeeat! tha was just i need...


Cordialmente,

[cid:image001.png@01CCF7BF.F2ECEF50]

Camilo Casadiego Espitia
Arquitecto de SW
* + 57 1 6393000
* camilo.casadiego@adv.com.co<ma...@adv.com.co>
* http://www.adv.com.co<http://www.adv.com.co/>
Carrera 11 No. 93 - 53 P7
Bogotá - Colombia



De: Jérôme Serré [mailto:jerome.michel.serre@gmail.com]
Enviado el: Thursday, March 01, 2012 11:04 AM
Para: user@pivot.apache.org
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:sandro.martini@gmail.com]
Envoyé : jeudi 1 mars 2012 16:58
À : user@pivot.apache.org<ma...@pivot.apache.org>
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

RE: Pivot pdf viewer

Posted by Jérôme Serré <je...@gmail.com>.
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:sandro.martini@gmail.com] 
Envoyé : jeudi 1 mars 2012 16:58
À : user@pivot.apache.org
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


Re: Pivot pdf viewer

Posted by Sandro Martini <sa...@gmail.com>.
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

RE: Pivot pdf viewer

Posted by Jason Dorsey <Ja...@netiq.com>.
When you say "open" are you trying to have it render in the application or use their system default for viewing the file?


Jason Dorsey | Engineering Intern
1233 West Loop South
Houston, TX 77027 USA
Jason.Dorsey@netiq.com<ma...@attachmate.com>
www.attachmate.com<http://www.attachmate.com>  |  www.netiq.com<http://www.netiq.com>



From: Camilo Casadiego [mailto:Camilo.Casadiego@adv.co]
Sent: Thursday, March 01, 2012 9:34 AM
To: user@pivot.apache.org
Subject: RE: Pivot pdf viewer

Actually the option were I let the user select the renderer its OK, i want something like it works in most webpages that the system asks you if you want to open or store the file...any idea how can achieve this on pivot?


Cordialmente,

[::::ADV_Logo_CMYK300_Color.png]

Camilo Casadiego Espitia
Arquitecto de SW
* + 57 1 6393000
* camilo.casadiego@adv.com.co<ma...@adv.com.co>
* http://www.adv.com.co<http://www.adv.com.co/>
Carrera 11 No. 93 - 53 P7
Bogotá - Colombia



De: Sandro Martini [mailto:sandro.martini@gmail.com]
Enviado el: Thursday, March 01, 2012 9:00 AM
Para: user@pivot.apache.org
Asunto: Re: Pivot pdf viewer

Hi Camilo,
I'm sorry, haven't direct experience on displaying PDF from Java (only generating them in many ways :-) ), but I can suggest you some tests:
- PDF-Renderer, from http://java.net/projects/pdf-renderer/
- PDFBox, from Apache: http://pdfbox.apache.org , it should have even the ability to transform a PDF in an image (don't know it single page, or even multi-page), take a look here: http://pdfbox.apache.org/commandlineutilities/PDFToImage.html
- iText ( http://itextpdf.com/ ), everything on PDF but not for display ... but maybe it has something to render it to an image ...
  -- wait a moment, maybe the following example could help: http://itextpdf.com/examples/iia.php?id=259

- there are many others (most on generation/parsing), but really open-source I think not-so-much, take a look even here for a list:
http://java-source.net/open-source/pdf-libraries

- and as last option (but of course not so platform independent), in your application let the user set the command to execute the desired PDF Viewer ...


Note that probably all Java libraries use Swing as a graphics backend (amd maybe someone even with for SWT), so I think it will be better to handle it in a different window.


Keep us updated ...


Bye

2012/3/1 Camilo Casadiego <Ca...@adv.co>>
Hi there, I have a doubt...In the server side of my application I generate a pdf file and then I sent such file to the client through a webservice interface...How can I show this pdf or excel file ebbed into the pivot client


Cordialmente,

[::::ADV_Logo_CMYK300_Color.png]

Camilo Casadiego Espitia
Arquitecto de SW
* + 57 1 6393000<tel:%2B%2057%201%206393000>
* camilo.casadiego@adv.com.co<ma...@adv.com.co>
* http://www.adv.com.co<http://www.adv.com.co/>
Carrera 11 No. 93 - 53 P7
Bogotá - Colombia





RE: Pivot pdf viewer

Posted by Camilo Casadiego <Ca...@adv.co>.
Actually the option were I let the user select the renderer its OK, i want something like it works in most webpages that the system asks you if you want to open or store the file...any idea how can achieve this on pivot?


Cordialmente,

[cid:image001.png@01CCF796.DC9D4070]

Camilo Casadiego Espitia
Arquitecto de SW
* + 57 1 6393000
* camilo.casadiego@adv.com.co<ma...@adv.com.co>
* http://www.adv.com.co<http://www.adv.com.co/>
Carrera 11 No. 93 - 53 P7
Bogotá - Colombia



De: Sandro Martini [mailto:sandro.martini@gmail.com]
Enviado el: Thursday, March 01, 2012 9:00 AM
Para: user@pivot.apache.org
Asunto: Re: Pivot pdf viewer

Hi Camilo,
I'm sorry, haven't direct experience on displaying PDF from Java (only generating them in many ways :-) ), but I can suggest you some tests:
- PDF-Renderer, from http://java.net/projects/pdf-renderer/
- PDFBox, from Apache: http://pdfbox.apache.org , it should have even the ability to transform a PDF in an image (don't know it single page, or even multi-page), take a look here: http://pdfbox.apache.org/commandlineutilities/PDFToImage.html
- iText ( http://itextpdf.com/ ), everything on PDF but not for display ... but maybe it has something to render it to an image ...
  -- wait a moment, maybe the following example could help: http://itextpdf.com/examples/iia.php?id=259

- there are many others (most on generation/parsing), but really open-source I think not-so-much, take a look even here for a list:
http://java-source.net/open-source/pdf-libraries

- and as last option (but of course not so platform independent), in your application let the user set the command to execute the desired PDF Viewer ...


Note that probably all Java libraries use Swing as a graphics backend (amd maybe someone even with for SWT), so I think it will be better to handle it in a different window.


Keep us updated ...


Bye


2012/3/1 Camilo Casadiego <Ca...@adv.co>>
Hi there, I have a doubt...In the server side of my application I generate a pdf file and then I sent such file to the client through a webservice interface...How can I show this pdf or excel file ebbed into the pivot client


Cordialmente,

[cid:image001.png@01CCF796.DC9D4070]

Camilo Casadiego Espitia
Arquitecto de SW
* + 57 1 6393000<tel:%2B%2057%201%206393000>
* camilo.casadiego@adv.com.co<ma...@adv.com.co>
* http://www.adv.com.co<http://www.adv.com.co/>
Carrera 11 No. 93 - 53 P7
Bogotá - Colombia





Re: Pivot pdf viewer

Posted by Sandro Martini <sa...@gmail.com>.
Hi Camilo,
I'm sorry, haven't direct experience on displaying PDF from Java (only
generating them in many ways :-) ), but I can suggest you some tests:
- PDF-Renderer, from http://java.net/projects/pdf-renderer/
- PDFBox, from Apache: http://pdfbox.apache.org , it should have even the
ability to transform a PDF in an image (don't know it single page, or even
multi-page), take a look here:
http://pdfbox.apache.org/commandlineutilities/PDFToImage.html
- iText ( http://itextpdf.com/ ), everything on PDF but not for display ...
but maybe it has something to render it to an image ...
  -- wait a moment, maybe the following example could help:
http://itextpdf.com/examples/iia.php?id=259

- there are many others (most on generation/parsing), but really
open-source I think not-so-much, take a look even here for a list:
http://java-source.net/open-source/pdf-libraries

- and as last option (but of course not so platform independent), in your
application let the user set the command to execute the desired PDF Viewer
...


Note that probably all Java libraries use Swing as a graphics backend (amd
maybe someone even with for SWT), so I think it will be better to handle it
in a different window.


Keep us updated ...


Bye



2012/3/1 Camilo Casadiego <Ca...@adv.co>

> Hi there, I have a doubt...In the server side of my application I generate
> a pdf file and then I sent such file to the client through a webservice
> interface...How can I show this pdf or excel file ebbed into the pivot
> client****
>
> ** **
>
> ** **
>
> *Cordialmente,*****
>
>  ****
>
> [image: ::::ADV_Logo_CMYK300_Color.png]****
>
> *Camilo Casadiego Espitia***
>
> *Arquitecto de SW*****
>
> *(* + 57 1 6393000 ****
>
> * camilo.casadiego@adv.com.co****
>
> *:* http://www.adv.com.co****
>
> Carrera 11 No. 93 – 53 P7****
>
> Bogotá - Colombia****
>
> ** **
>
> ** **
>