Hi Michael,

  I still can't reproduce your problem.  What happens if you
use the svgrasterizer from the batik distribution to rasterize
your document?

  If you want to submit a standalone testcase with all the
relevant content and source I'll try and look at it (preferably
through Bugzilla).

  The way you are rasterizing the document is a bit odd although
I don't see anything in particular wrong with it.  It isn't clear to
me how you go from the Rendered Image to what you attached however.

Michael Voyes wrote:

Suppose you create the following SVG Document :

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 10.0, SVG Export Plug-In . SVG Version: 3.0.0 Build 76) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"; [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/";>
<!ENTITY ns_svg "http://www.w3.org/2000/svg";>
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink";>
]>
<svg xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/";
width="3508" height="2480" viewBox="0 0 3508 2480" overflow="visible" enable-background="new 0 0 3508 2480" xml:space="preserve">
<g id="Layer_1">
<rect x="0" y="0" width="3508" height="2480" fill="#ffffff" />
<image width="250" height="250" transform="matrix(1 0 0 1 50 50)" preserveAspectRatio="xMidYMid meet" id="XMLID_1_" xlink:href="logo.gif"/>
</g>
</svg>


The logo.gif file is represented by the guy lying on the top of the logo.gif file attached to this e-mail.

Firstly, You create a DOM representation (doc) of this document in your code.

Secondly:
OutputStream outputStream = new FileOutputStream  (outputFileName);
ByteArrayOutputStream ostream = new ByteArrayOutputStream();
TranscoderOutput output = new TranscoderOutput(ostream);
SVGAbstractTranscoder transDoc = new SVGAbstractTranscoder();

transDoc.transcode((Document)doc, (OutputStream)outputFileName, output);
Filter f = transDoc.root.getGraphicsNodeRable(true);
curTxf = new AffineTransform();
RenderContext rc = new RenderContext(curTxf, null, null);
RenderedImage img = f.createRendering(rc);

Then, I flush "img" into "outputStream" and visualize the image. The result is represented by the gray shade lying at the bottom of the logo.gif file attached here.
As you can see, the logo.gif file is not well rendered, it is cropped. My SVG File normally indicates that i want to fit the 522*286 pixels logo guy into the 250*250 pixels box, but it doesn't (cf. gray shade).


What's wrong in my code? or in the SVG?  Is there a Bug in Batik ?

Thank you in Advance.


------------------------------------------------------------------------


------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to