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 Christian Pestel <ch...@orange.fr> on 2012/05/29 12:11:48 UTC

pdf file not closed in case of invalid fo / fop Trunk

Hello developpers,

When an invalid fo is converted to pdf, a Fop error occured. 
Created pdf file has a zero filesize, and it’s not possible to delete the pdf file because file seems not closed by Fop in this case; the only solution is to restart java.exe.

in my example, I replace fo: block by fo: block1 


org.apache.fop.fo.ValidationException: "{http://www.w3.org/1999/XSL/Format}block1" is not a valid child of "fo:flow"!





Christian Pestel

christian.pestel@orange.fr

Re: pdf file not closed in case of invalid fo / fop Trunk

Posted by Christian Pestel <ch...@orange.fr>.
Hi Alexis,

Thank you for your detailed answer.
It's work fine with out.close(); in finally section.

Christian Pestel

christian.pestel@orange.fr


-----Message d'origine----- 
From: Alexios Giotis
Sent: Tuesday, May 29, 2012 12:29 PM
To: Christian Pestel
Cc: fop-users
Subject: Re: pdf file not closed in case of invalid fo / fop Trunk

Hi Christian,

I assume you are using FOP embedded in a java application. In this case, FOP 
public API takes as an argument an output stream to write the specified 
output format, for example, see [1]. Make sure that the output stream is 
closed by your code, when an exception is thrown, as in the finally block 
near the end of [1]. If the file is still kept open, then a small java code 
reproducing the problem would help.

HTH,
Alexis Giotis

[1] 
http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleXML2PDF.java



On May 29, 2012, at 1:11 PM, Christian Pestel wrote:

> Hello developpers,
>
> When an invalid fo is converted to pdf, a Fop error occured.
> Created pdf file has a zero filesize, and it’s not possible to delete the 
> pdf file because file seems not closed by Fop in this case; the only 
> solution is to restart java.exe.
>
> in my example, I replace fo: block by fo: block1
>
> org.apache.fop.fo.ValidationException: 
> "{http://www.w3.org/1999/XSL/Format}block1" is not a valid child of 
> "fo:flow"!
>
>
> Christian Pestel
> christian.pestel@orange.fr


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


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


Re: pdf file not closed in case of invalid fo / fop Trunk

Posted by Alexios Giotis <al...@gmail.com>.
Hi Christian,

I assume you are using FOP embedded in a java application. In this case, FOP public API takes as an argument an output stream to write the specified output format, for example, see [1]. Make sure that the output stream is closed by your code, when an exception is thrown, as in the finally block near the end of [1]. If the file is still kept open, then a small java code reproducing the problem would help.

HTH,
Alexis Giotis

[1] http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleXML2PDF.java



On May 29, 2012, at 1:11 PM, Christian Pestel wrote:

> Hello developpers,
>  
> When an invalid fo is converted to pdf, a Fop error occured.
> Created pdf file has a zero filesize, and it’s not possible to delete the pdf file because file seems not closed by Fop in this case; the only solution is to restart java.exe.
>  
> in my example, I replace fo: block by fo: block1
>  
> org.apache.fop.fo.ValidationException: "{http://www.w3.org/1999/XSL/Format}block1" is not a valid child of "fo:flow"!
>  
>  
> Christian Pestel
> christian.pestel@orange.fr


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