You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by ruben malchow <r_...@web.de> on 2006/09/27 12:02:19 UTC

eps transcoder headless exception


hello,

when using the epstranscoder in headless mode with a transparent svg 
element, this exception is thrown:

[...]
2006.09.27 11:34:30 - TranscodeUtils...... - ERROR    
java.awt.HeadlessException (null)
2006.09.27 11:34:30 - TranscodeUtils...... - ERROR    
java.awt.HeadlessException
2006.09.27 11:34:30 - TranscodeUtils...... - ERROR        at 
sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice(HeadlessGraphicsEnvironment.java:66)
2006.09.27 11:34:30 - TranscodeUtils...... - ERROR        at 
org.apache.xmlgraphics.java2d.ps.PSGraphics2D.getDeviceConfiguration(PSGraphics2D.java:759)
2006.09.27 11:34:30 - TranscodeUtils...... - ERROR        at 
org.apache.batik.ext.awt.image.GraphicsUtil.getDestination(GraphicsUtil.java:511)
2006.09.27 11:34:30 - TranscodeUtils...... - ERROR        at 
org.apache.batik.ext.awt.image.GraphicsUtil.getDestinationColorModel(GraphicsUtil.java:525)
[...]

my code that's calling the epstranscoder is this:

        System.err.println("saving eps ... ");
        try {
            EPSTranscoder t = new EPSTranscoder();
            TranscoderInput input = new TranscoderInput(doc);
            TranscoderOutput output = new TranscoderOutput(os);
            t.transcode(input, output);
        } catch (Exception e) {
            logger.error(e);
        }


now, if i run this in "normal" mode (i.e., not headless), the error is 
not thrown, but the transparencies and strokes are not drawn correctly, 
either. the elements are always fully opaque, and the strokes are 
cropped to the actual path of the element, with parts of the stroke 
extending to the outside not being rendered.

i am including an exampleof this behaviour (not including the stroke 
thing for now). these were rendered using jdk1.4.2 and the most recent 
svn revision as of 20 minutes ago. is this something i should file a bug 
report for?

.rm








Re: eps transcoder headless exception

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Answered on batik-users.

On 27.09.2006 12:02:19 ruben malchow wrote:
> 
> 
> hello,
> 
> when using the epstranscoder in headless mode with a transparent svg 
> element, this exception is thrown:
> 
> [...]
> 2006.09.27 11:34:30 - TranscodeUtils...... - ERROR    
> java.awt.HeadlessException (null)
> 2006.09.27 11:34:30 - TranscodeUtils...... - ERROR    
> java.awt.HeadlessException
> 2006.09.27 11:34:30 - TranscodeUtils...... - ERROR        at 
> sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice(HeadlessGraphicsEnvironment.java:66)
> 2006.09.27 11:34:30 - TranscodeUtils...... - ERROR        at 
> org.apache.xmlgraphics.java2d.ps.PSGraphics2D.getDeviceConfiguration(PSGraphics2D.java:759)
> 2006.09.27 11:34:30 - TranscodeUtils...... - ERROR        at 
> org.apache.batik.ext.awt.image.GraphicsUtil.getDestination(GraphicsUtil.java:511)
> 2006.09.27 11:34:30 - TranscodeUtils...... - ERROR        at 
> org.apache.batik.ext.awt.image.GraphicsUtil.getDestinationColorModel(GraphicsUtil.java:525)
> [...]
> 
> my code that's calling the epstranscoder is this:
> 
>         System.err.println("saving eps ... ");
>         try {
>             EPSTranscoder t = new EPSTranscoder();
>             TranscoderInput input = new TranscoderInput(doc);
>             TranscoderOutput output = new TranscoderOutput(os);
>             t.transcode(input, output);
>         } catch (Exception e) {
>             logger.error(e);
>         }
> 
> 
> now, if i run this in "normal" mode (i.e., not headless), the error is 
> not thrown, but the transparencies and strokes are not drawn correctly, 
> either. the elements are always fully opaque, and the strokes are 
> cropped to the actual path of the element, with parts of the stroke 
> extending to the outside not being rendered.
> 
> i am including an exampleof this behaviour (not including the stroke 
> thing for now). these were rendered using jdk1.4.2 and the most recent 
> svn revision as of 20 minutes ago. is this something i should file a bug 
> report for?
> 
> .rm


Jeremias Maerki


Re: eps transcoder headless exception

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 27.09.2006 12:02:19 ruben malchow wrote:
> 
> 
> hello,
> 
> when using the epstranscoder in headless mode with a transparent svg 
> element, this exception is thrown:
> 
> [...]
> 2006.09.27 11:34:30 - TranscodeUtils...... - ERROR    
> java.awt.HeadlessException (null)
> 2006.09.27 11:34:30 - TranscodeUtils...... - ERROR    
> java.awt.HeadlessException
> 2006.09.27 11:34:30 - TranscodeUtils...... - ERROR        at 
> sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice(HeadlessGraphicsEnvironment.java:66)
> 2006.09.27 11:34:30 - TranscodeUtils...... - ERROR        at 
> org.apache.xmlgraphics.java2d.ps.PSGraphics2D.getDeviceConfiguration(PSGraphics2D.java:759)
> 2006.09.27 11:34:30 - TranscodeUtils...... - ERROR        at 
> org.apache.batik.ext.awt.image.GraphicsUtil.getDestination(GraphicsUtil.java:511)
> 2006.09.27 11:34:30 - TranscodeUtils...... - ERROR        at 
> org.apache.batik.ext.awt.image.GraphicsUtil.getDestinationColorModel(GraphicsUtil.java:525)
> [...]

This needs to be handled in one of the three ways outlined under:
http://xmlgraphics.apache.org/fop/latest/graphics.html#batik

Since you're using Java 1.4.2, using "-Djava.awt.headless=true" is
obviously the first choice.

> my code that's calling the epstranscoder is this:
> 
>         System.err.println("saving eps ... ");
>         try {
>             EPSTranscoder t = new EPSTranscoder();
>             TranscoderInput input = new TranscoderInput(doc);
>             TranscoderOutput output = new TranscoderOutput(os);
>             t.transcode(input, output);
>         } catch (Exception e) {
>             logger.error(e);
>         }
> 
> 
> now, if i run this in "normal" mode (i.e., not headless), the error is 
> not thrown, but the transparencies and strokes are not drawn correctly, 
> either. the elements are always fully opaque, and the strokes are 
> cropped to the actual path of the element, with parts of the stroke 
> extending to the outside not being rendered.

That's to be expected. Those features are not implemented, yet. :-)

> i am including an exampleof this behaviour (not including the stroke 
> thing for now). these were rendered using jdk1.4.2 and the most recent 
> svn revision as of 20 minutes ago. is this something i should file a bug 
> report for?

It's not a bug, it's a missing feature. You could volunteer to help
improve this part. That would be way cool!

Jeremias Maerki


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