You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Joshua Marinacci <jo...@joshy.net> on 2005/04/26 15:31:09 UTC
Black background problem
Hi guys. I've just started to use Batik. It's pretty cool!
I'm working on a program to convert SVG to EPS. I have made a simple
app which loads an SVG file into a JSVGCanvas and shows it on screen.
This works fine. When I want to export to EPS I create an EpsGraphics2D
object and pass it into the paint method of my canvas. The resulting
file looks fine except that the background is black. If I paint a blue
background onto the graphics and then paint the svg canvas I get blue
everywhere outside the bounds of the canvas, but the background of the
canvas is still black. I can paint a blue background on top of the svg
canvas and that works too. It's just the actual canvas area that seems
to get the black background. Strangely the on screen painting of the
canvas is white, though. It's only painting to the EpsGraphics2D where
it produces the black.
Any ideas?
oh, the eps graphics project is here:
http://www.jibble.org/epsgraphics/
Thanks.
- Joshua
Re: Black background problem
Posted by Jeremias Maerki <de...@greenmail.ch>.
Guessed correctly, I'm afraid. The EPS output is not as far advanced as
the other output formats. PDF output should work with gradients.
I don't have this stuff present in my brain right now but maybe it's
possible to let Batik render the gradients as bitmaps which the EPS
output then uses. But it could also be that the bitmap support in the
EPS output is also not quite there, yet.
On 26.04.2005 16:14:43 Joshua Marinacci wrote:
> Thanks. That works well and means I have one less dependency. I'm also
> interested in PDF and EPS rendering for Flying Saucer (an XHMTL
> Renderer).
>
> On thing to note. I'm converting an SVG I got from the open clip art
> library. It's a picture of a leave with shades of brown and red. The
> resulting EPS still has the green strokes but the shaded background
> turns to plain black. I'm guessing that EPS doesn't support gradients?
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Black background problem
Posted by Joshua Marinacci <jo...@joshy.net>.
Thanks. That works well and means I have one less dependency. I'm also
interested in PDF and EPS rendering for Flying Saucer (an XHMTL
Renderer).
On thing to note. I'm converting an SVG I got from the open clip art
library. It's a picture of a leave with shades of brown and red. The
resulting EPS still has the green strokes but the shaded background
turns to plain black. I'm guessing that EPS doesn't support gradients?
Thanks,
- Josh
On Apr 26, 2005, at 9:53 AM, Jeremias Maerki wrote:
> I'd try using the EPSTranscoder that's in pdf-transcoder.jar coming
> with
> Batik. The full class name is: org.apache.fop.render.ps.EPSTranscoder.
> Just follow the basic transcoding pattern described here:
> http://xml.apache.org/batik/rasterizerTutorial.html
>
> As an alternative you can also try
> org.apache.fop.render.ps.EPSDocumentGraphics2D which should be roughly
> equivalent to the thing you used.
>
> On 26.04.2005 15:31:09 Joshua Marinacci wrote:
>> Hi guys. I've just started to use Batik. It's pretty cool!
>>
>> I'm working on a program to convert SVG to EPS. I have made a simple
>> app which loads an SVG file into a JSVGCanvas and shows it on screen.
>> This works fine. When I want to export to EPS I create an
>> EpsGraphics2D
>> object and pass it into the paint method of my canvas. The resulting
>> file looks fine except that the background is black. If I paint a
>> blue
>> background onto the graphics and then paint the svg canvas I get blue
>> everywhere outside the bounds of the canvas, but the background of the
>> canvas is still black. I can paint a blue background on top of the svg
>> canvas and that works too. It's just the actual canvas area that seems
>> to get the black background. Strangely the on screen painting of the
>> canvas is white, though. It's only painting to the EpsGraphics2D where
>> it produces the black.
>>
>> Any ideas?
>>
>> oh, the eps graphics project is here:
>>
>> http://www.jibble.org/epsgraphics/
>>
>> Thanks.
>>
>> - Joshua
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail:
> batik-users-help@xmlgraphics.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Black background problem
Posted by Jeremias Maerki <de...@greenmail.ch>.
I'd try using the EPSTranscoder that's in pdf-transcoder.jar coming with
Batik. The full class name is: org.apache.fop.render.ps.EPSTranscoder.
Just follow the basic transcoding pattern described here:
http://xml.apache.org/batik/rasterizerTutorial.html
As an alternative you can also try
org.apache.fop.render.ps.EPSDocumentGraphics2D which should be roughly
equivalent to the thing you used.
On 26.04.2005 15:31:09 Joshua Marinacci wrote:
> Hi guys. I've just started to use Batik. It's pretty cool!
>
> I'm working on a program to convert SVG to EPS. I have made a simple
> app which loads an SVG file into a JSVGCanvas and shows it on screen.
> This works fine. When I want to export to EPS I create an EpsGraphics2D
> object and pass it into the paint method of my canvas. The resulting
> file looks fine except that the background is black. If I paint a blue
> background onto the graphics and then paint the svg canvas I get blue
> everywhere outside the bounds of the canvas, but the background of the
> canvas is still black. I can paint a blue background on top of the svg
> canvas and that works too. It's just the actual canvas area that seems
> to get the black background. Strangely the on screen painting of the
> canvas is white, though. It's only painting to the EpsGraphics2D where
> it produces the black.
>
> Any ideas?
>
> oh, the eps graphics project is here:
>
> http://www.jibble.org/epsgraphics/
>
> Thanks.
>
> - Joshua
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org