Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Show PDF file on client
Show PDF file on client [message #1278502] Thu, 27 March 2014 08:23 Go to next message
Karel Haruda is currently offline Karel Haruda
Messages: 16
Registered: March 2014
Junior Member
Hi,
Does anyone know how to preview PDF file on client ? I generate PDF file on server, next i transport it as byte[] to client. On client i save it as PDF file and now i need to show pdf.

thx ..
Re: Show PDF file on client [message #1278505 is a reply to message #1278502] Thu, 27 March 2014 08:30 Go to previous messageGo to next message
Matthias Nick is currently offline Matthias Nick
Messages: 163
Registered: August 2013
Senior Member
Hi Karel,
if you are using the desktop client and have a PDF Viewer installed, you could use the following snippet:

if (Desktop.isDesktopSupported()) {
 try {
  File myFile = new File("c:\\myfile.pdf");
  Desktop.getDesktop().open(myFile);
 }
 catch (IOException ex) {
  // no application registered for PDFs
 }
}


Does this help you?
Re: Show PDF file on client [message #1278508 is a reply to message #1278505] Thu, 27 March 2014 08:32 Go to previous messageGo to next message
Karel Haruda is currently offline Karel Haruda
Messages: 16
Registered: March 2014
Junior Member
yes .. i find scout solution .. but pricip is same .. thx for answer ..
SERVICES.getService(IShellService.class).shellOpen(temp.getAbsolutePath()); (temp is File class)
Re: Show PDF file on client [message #1278511 is a reply to message #1278508] Thu, 27 March 2014 08:39 Go to previous message
Matthias Nick is currently offline Matthias Nick
Messages: 163
Registered: August 2013
Senior Member
Ah cool, I forgot about that.
Thanks for sharing your solution
Previous Topic:Trouble after updating to nightly Luna build
Next Topic:Dynamic resizing of table columns
Goto Forum:
  


Current Time: Fri Aug 29 18:37:41 EDT 2014

Powered by FUDForum. Page generated in 0.01597 seconds