Re: Suppress RTF

2006-06-08 Thread Jeremias Maerki

On 09.06.2006 00:08:52 Andreas L Delmelle wrote:
> On Jun 8, 2006, at 16:40, Will Peterson wrote:
> 
> Hi Will,
> 
> > Quick question,
> >
> > I am going to customize FOP to suppress the RTF gif image exception  
> > when rendering documents.  (i.e.  
> > org.apache.fop.render.rtf.rtflib.rtfdoc.RtfExternalGraphic 
> > $ExternalGraphicException: The tag  does not  
> > support gif - image type.)
> >
> > Would it be recommended to recompile the whole fop.jar, or should I  
> > just customize the one class (RtfExternalGraphic) and include it on  
> > the class path.  Any suggestions here.
> 
> In theory, the following should work:
> 
> 1° download the FOP sources, modify that one class, then 'ant compile'
> 2° in the build directory, look for the .class file in question
> 3° replace the file in the fop.jar you already have with the freshly  
> compiled one
> 
> Then again, I'm wondering why I would do this... but it might be  
> handy if you need to minimize the hassle of maintaining a customized  
> FOP version :/
> As for myself, I'd probably just modify the source file, run 'ant  
> package', and replace the whole fop.jar.
> 
> If you have any interest in extending your customization to be a  
> configurable RTFRenderer-specific option, patches are welcome ;)

I think that would be the best approach. That the RTF output generates
some text in the output file if it encounters a problem loading an image
is a legacy from JFOR times. In our other output formats we send the
error message to the log and continue with no image. Not the best
approach either, depending on the requirements. So, for the moment it
may be better to simply change the code to issue a warning on the log
and ignore the image to match the behaviour of the other output formats.
For the long term, the following will be the right way to go:
http://wiki.apache.org/xmlgraphics-fop/ProcessingFeedback

Jeremias Maerki



Re: Suppress RTF

2006-06-08 Thread Andreas L Delmelle

On Jun 9, 2006, at 00:08, Andreas L Delmelle wrote:


On Jun 8, 2006, at 16:40, Will Peterson wrote:



Would it be recommended to recompile the whole fop.jar, or should  
I just customize the one class (RtfExternalGraphic) and include it  
on the class path.  Any suggestions here.


In theory, the following should work:


Just realized that this may lead to very nasty runtime errors if some  
fop-dev decides on altering classes that one class depends on... So,  
yeah, would work in theory, provided that the related codebase isn't  
out-of-sync with your own version...


In short: if I were you, I'd go for the complete rebuild. That's the  
least likely to cause you any headaches.


Later,

Andreas



Re: Suppress RTF

2006-06-08 Thread Andreas L Delmelle

On Jun 8, 2006, at 16:40, Will Peterson wrote:

Hi Will,


Quick question,

I am going to customize FOP to suppress the RTF gif image exception  
when rendering documents.  (i.e.  
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfExternalGraphic 
$ExternalGraphicException: The tag  does not  
support gif - image type.)


Would it be recommended to recompile the whole fop.jar, or should I  
just customize the one class (RtfExternalGraphic) and include it on  
the class path.  Any suggestions here.


In theory, the following should work:

1° download the FOP sources, modify that one class, then 'ant compile'
2° in the build directory, look for the .class file in question
3° replace the file in the fop.jar you already have with the freshly  
compiled one


Then again, I'm wondering why I would do this... but it might be  
handy if you need to minimize the hassle of maintaining a customized  
FOP version :/
As for myself, I'd probably just modify the source file, run 'ant  
package', and replace the whole fop.jar.


If you have any interest in extending your customization to be a  
configurable RTFRenderer-specific option, patches are welcome ;)



Cheers,

Andreas

Re: Suppress RTF ExternalGraphicException

2006-03-20 Thread Andreas L Delmelle

On Mar 20, 2006, at 19:17, [EMAIL PROTECTED] wrote:


Von: "Andreas L Delmelle"<[EMAIL PROTECTED]>


On Mar 17, 2006, at 20:12, Will Peterson wrote:

Hi Will,


Is there a way to suppress the ExternalGraphicException text that
renders inside an RTF document?  Such that the document would be
rendered but exclude the text:
"org.apache.fop.render.rtf.rtflib.rtfdoc.RtfExternalGraphic
$ExternalGraphicException: The tag  does not
support gif - image type." (as well as the GIF image, of course)


I'm afraid it's hard-coded, but if you don't mind altering the class
itself, and then rebuild FOP, easy.
Just change the class in question's writeRtfContent() method, and
make that catch block a NOP. Should work nicely.
But where's the error message? RTF-output does not produce any  
errors, that it's not able to insert the image...the better way  
would be, to transform all the GIFs to PNGs. I use docbook to  
create documents, so there's no need for me to write XSL-FO (it's  
also easy to include into any Java-application, just use the  
docbook-stylesheets and DTDs) AND it's possible to specify  
different media types for different rendering systems (GIF for  
HTML, PNG for FO or RTF-FO). So you see the image, too


Hey, if you wanna have a go at converting GIFs to PNGs on-the-fly,  
then by all means, go ahead. The community will be grateful. :)


The OP asked how he could turn it off, hence my answer.

Cheers,

Andreas



Re: Re: Suppress RTF ExternalGraphicException

2006-03-20 Thread b . ohnsorg

- original Nachricht 

Betreff: Re: Suppress RTF ExternalGraphicException
Gesendet: Fr 17 Mär 2006 20:26:16 CET
Von: "Andreas L Delmelle"<[EMAIL PROTECTED]>

> 
> On Mar 17, 2006, at 20:12, Will Peterson wrote:
> 
> Hi Will,
> 
> > Is there a way to suppress the ExternalGraphicException text that  
> > renders inside an RTF document?  Such that the document would be  
> > rendered but exclude the text:
> > "org.apache.fop.render.rtf.rtflib.rtfdoc.RtfExternalGraphic 
> > $ExternalGraphicException: The tag  does not  
> > support gif - image type." (as well as the GIF image, of course)
> 
> I'm afraid it's hard-coded, but if you don't mind altering the class  
> itself, and then rebuild FOP, easy.
> Just change the class in question's writeRtfContent() method, and  
> make that catch block a NOP. Should work nicely.
But where's the error message? RTF-output does not produce any errors, that 
it's not able to insert the image...the better way would be, to transform all 
the GIFs to PNGs. I use docbook to create documents, so there's no need for me 
to write XSL-FO (it's also easy to include into any Java-application, just use 
the docbook-stylesheets and DTDs) AND it's possible to specify different media 
types for different rendering systems (GIF for HTML, PNG for FO or RTF-FO). So 
you see the image, too

> 
> Cheers,
> 
> Andreas
> 
> 

--- original Nachricht Ende 











Re: Suppress RTF ExternalGraphicException

2006-03-17 Thread Andreas L Delmelle


On Mar 17, 2006, at 20:12, Will Peterson wrote:

Hi Will,

Is there a way to suppress the ExternalGraphicException text that  
renders inside an RTF document?  Such that the document would be  
rendered but exclude the text:
"org.apache.fop.render.rtf.rtflib.rtfdoc.RtfExternalGraphic 
$ExternalGraphicException: The tag  does not  
support gif - image type." (as well as the GIF image, of course)


I'm afraid it's hard-coded, but if you don't mind altering the class  
itself, and then rebuild FOP, easy.
Just change the class in question's writeRtfContent() method, and  
make that catch block a NOP. Should work nicely.


Cheers,

Andreas