You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Illiano, Vincent" <IL...@onyx.dcri.duke.edu> on 2002/11/27 15:14:11 UTC

Writing to a file already open in another application

Hi Fellow FOPers,

I've run into a problem when generating pdf's with FOP.  When the target pdf
file is already open in Acrobat, or any other application for that matter,
FOP cannot regenerate the pdf file.  I see the following message in the FOP
console window (running fop.bat):

java.io.FileNotFoundException:  output\histphys.pdf (The process cannot
access the file because it is being used by another process)
	at java.io.FileOutputStream.open(Native Method)
...

Does anybody know of a way to get FOP and Java to rewrite the file even
though it's open in another app?  Thanks, -Vincent

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Writing to a file already open in another application

Posted by Jeremias Maerki <de...@greenmail.ch>.
I thought so, yes.

On 27.11.2002 15:29:27 Illiano, Vincent wrote:
> Is Acrobat OLE-Automatable?  My controlling application is an MFC app, so I
> could easily establish an OLE connection to Acrobat if that's possible.


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Writing to a file already open in another application

Posted by Noel Golding <no...@spearreport.com>.
If the pdf is launched in the IE browser, it does not lock the file.


----- Original Message -----
From: "Jeremias Maerki" <de...@greenmail.ch>
To: <fo...@xml.apache.org>
Sent: Wednesday, November 27, 2002 9:25 AM
Subject: Re: Writing to a file already open in another application


> You can't because Acrobat has an exclusive lock on the file. There's no
> way to release that lock other than to tell Acrobat to close the file
> either by closing the window with the mouse or by closing the file over
> OLE automation (not an easy task in Java).
>
> By the way, GhostScript doesn't lock the file when viewing it. It even
> reloads the file automatically when it's regenerated.
>
> On 27.11.2002 15:14:11 Illiano, Vincent wrote:
> > Hi Fellow FOPers,
> >
> > I've run into a problem when generating pdf's with FOP.  When the target
pdf
> > file is already open in Acrobat, or any other application for that
matter,
> > FOP cannot regenerate the pdf file.  I see the following message in the
FOP
> > console window (running fop.bat):
> >
> > java.io.FileNotFoundException:  output\histphys.pdf (The process cannot
> > access the file because it is being used by another process)
> > at java.io.FileOutputStream.open(Native Method)
> > ...
> >
> > Does anybody know of a way to get FOP and Java to rewrite the file even
> > though it's open in another app?  Thanks, -Vincent
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Writing to a file already open in another application

Posted by Jeremias Maerki <de...@greenmail.ch>.
You can't because Acrobat has an exclusive lock on the file. There's no
way to release that lock other than to tell Acrobat to close the file
either by closing the window with the mouse or by closing the file over
OLE automation (not an easy task in Java).

By the way, GhostScript doesn't lock the file when viewing it. It even
reloads the file automatically when it's regenerated.

On 27.11.2002 15:14:11 Illiano, Vincent wrote:
> Hi Fellow FOPers,
> 
> I've run into a problem when generating pdf's with FOP.  When the target pdf
> file is already open in Acrobat, or any other application for that matter,
> FOP cannot regenerate the pdf file.  I see the following message in the FOP
> console window (running fop.bat):
> 
> java.io.FileNotFoundException:  output\histphys.pdf (The process cannot
> access the file because it is being used by another process)
> 	at java.io.FileOutputStream.open(Native Method)
> ...
> 
> Does anybody know of a way to get FOP and Java to rewrite the file even
> though it's open in another app?  Thanks, -Vincent



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org