Article View: borland.public.jbuilder.java.language
Article #7959Re: Calling Acrobat Reader from Java
From: Robert
Date: Thu, 03 May 2001 15:09
Date: Thu, 03 May 2001 15:09
45 lines
2249 bytes
2249 bytes
Hi ,
I use the runtime.
In this program:
o.printFilePdf(os) creates a file, intended to be sent by email
Then I prepare a command . auteur.acrobat is a string with the path to acrobat
reader and fileIdPdf is the file name
You get a new window with acrobat reader and your file.
I assume this is a answer to your problem
Robert
void jButtonPrintFile_actionPerformed(ActionEvent e)
{
//crοΏ½er un fichier pour envoi par email
try{
messages.setText ("printing....");
calculValid();
//o.printFileTxt();
String fileIdPdf = auteur.chemin+"Reports\\"+o.fileId+".pdf";
FileOutputStream os = new FileOutputStream(fileIdPdf);
o.printFilePdf(os);
// impression pdf:appel de acrobat reader
Runtime r = Runtime.getRuntime();
Process process = null;
String[] command = {auteur.acrobat,fileIdPdf };
process = r.exec(command);
messages.setText ("");
}
catch (Exception errPrintFile)
Erwin Olaerts wrote:
> Hi,
>
> Can I call Acrobat Reader from my Java-application to view a PDF ???
>
> In the print-tool I use, I can save my report as a PDF-file, but I want to
> view it with a call from my application. How can I do this ?
>
> Hope someone can help. Many thanks in advance,
> Erwin
Technical Details
Message-ID:
<3AF174AA.BB59E0C5@securex.be>Path:
arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out-sjo.usenetserver.com!hub1.nntpserver.com!news-in.nibble.net!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3aeffbf9_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f74b3,8a1ca0fc2d792ffd X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-05-03 08:40:06 PST Message-ID: <3AF174AA.BB59E0C5@securex.be> Date: Thu, 03 May 2001 17:09:31 +0200 From: Robert <robert.spilleboudt@securex.be> Organization: securex X-Mailer: Mozilla 4.76 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language Subject: Re: Calling Acrobat Reader from Java References: <3aeffbf9_1@dnews> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 194.78.83.226 X-Trace: dnews 988902586 194.78.83.226 (3 May 2001 08:09:46 -0700) Lines: 46 Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out-sjo.usenetserver.com!hub1.nntpserver.com!news-in.nibble.net!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews