Am Dienstag, 17. Juni 2003 16:52 schrieb [EMAIL PROTECTED]:

> hmm... you've forgot to flushing and closing the OutputStream!

Yes, sounds good.... Why didn't I see that, it's not really a hard thing to 
figure out?!
Well, now it works! Thanks a lot!!

To Torsten Erler: "Thread.sleep(20000);" was just to demonstrate that Acrobat 
is accessing the file while the application is still running. My real 
application is a GUI application that just starts Acrobat but doesn't exit 
itself, so that's what sleep() meant to simulate....


> >-- Original-Nachricht --
> >Reply-To: [EMAIL PROTECTED]
>
> From: Nicolas Michael <[EMAIL PROTECTED]>
>
> >To: [EMAIL PROTECTED]
> >Subject: FOP locks output file under WinXP
> >Date: Tue, 17 Jun 2003 16:44:47 +0200
> >
> >
> >Hi there!
> >
> >I've embedded FOP 0.20.4 in an application. I use it to create a PDF file
> >and
> >launch Acrobat to display the generated file. With Linux and Win98 this
>
> works
>
> >fine.
> >But some of my users use WinXP and have the problem, that Acrobat Reader
> >[6.0]
> >cannot open the generated PDF file "because it is still in use by an other
> >
> >application". [JRE 1.4.1]
> >
> >Here is some code to demonstrate the problem.
> >args[0] is the input xsl-fo file, args[1] is the pdf output file and
> > args[2]
> >
> >is the path to the Acrobat Reader exe file.
> >
> >I'd be glad if someone could help me how to solve this problem. Thanks!!
> >
> >--------------------------
> >class Test {
> >
> >  // args: Test <xsl-fo file> <pdf output file> <path to acrobat reader>
> >  public static void main(String[] args) {
> >    try {
> >      org.apache.fop.apps.Driver driver =
> >        new org.apache.fop.apps.Driver(new
> > org.xml.sax.InputSource(args[0]), new java.io.FileOutputStream(args[1]));
> > driver.setRenderer(org.apache.fop.apps.Driver.RENDER_PDF);
> >      driver.run();
> >      String[] cmd = new String[2];
> >      cmd[0] = args[2];
> >      cmd[1] = args[1];
> >      System.out.println("Starting Acrobat: "+cmd[0]+" "+cmd[1]);
> >      Runtime.getRuntime().exec(cmd);
> >      Thread.sleep(20000);
> >      System.out.println("done.");
> >    } catch(Exception e) {
> >      e.printStackTrace();
> >    }
> >  }
> >
> >}
> >--------------------------

-- 
man liest sich...

Nicolas Michael
mailto:[EMAIL PROTECTED]     http://www.nmichael.de/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to