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 Diego Cattelan <ne...@libero.it> on 2007/10/23 18:15:50 UTC
doc importing
Hi all, please try to understand my poor English.
Batik 1.7 beta 1
sun jdk 1.6.03
windows xp pro sp2
centrino duo, 2 gb ram
I'm writing an application that merges a number of svg documents created
externally using inkscape.
These documents are merged using importNode(...).
My problems are:
1) Imported document are slightly smaller, in dimension, than the size
of the object directly drawn.
Ex. I draw a rectangle of size
h = 150 mm
w = 50 mm
when I import (importNode) a document with the same size created with
inkscape the imported object is smaller in both width and height
Saving the final result of the merge as an svg and viewing it with
inkscape result in a perfect looking document where the drawn rectangle
and the imported document have the same size.
Opening the svg with squiggle have the same problem: different size
2) If an imported document contain an element outside the document size
it will be clipped on the document border. I need to draw elements even
in negative position without it being clipped at 0 coordinates.
Again, the saved SVG visualized with inkscape is looking correct.
What must i do for having batik behave like inkscape in these cases ?
Thank you
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: doc importing
Posted by th...@kodak.com.
Hi Diego,
news <ne...@ger.gmane.org> wrote on 10/23/2007 12:15:50 PM:
> I'm writing an application that merges a number of svg documents created
> externally using inkscape.
> These documents are merged using importNode(...).
>
> My problems are:
> 1) Imported document are slightly smaller, in dimension, than the size
> of the object directly drawn.
> Ex. I draw a rectangle of size
> h = 150 mm
> w = 50 mm
> when I import (importNode) a document with the same size created with
> inkscape the imported object is smaller in both width and height
So I'm curious how you are measuring this? I'm quite sure that
Batik isn't editing the width and height of the various elements.
If you are trying to measure it on the screen, than it is probably
the determination of the screen resolution that is the problem.
> Saving the final result of the merge as an svg and viewing it with
> inkscape result in a perfect looking document where the drawn rectangle
> and the imported document have the same size.
> Opening the svg with squiggle have the same problem: different size
You can adjust the mapping of real world units to 'px' units through
the SVGUserAgent.getPixelUnitToMillimeter(). I suspect that Batik's
default of 96dpi is too high for what ever you are using to view the
content.
> 2) If an imported document contain an element outside the document size
> it will be clipped on the document border. I need to draw elements even
> in negative position without it being clipped at 0 coordinates.
> Again, the saved SVG visualized with inkscape is looking correct.
This is a "bug" in Inkscape then. There is an implict clip to the
bounds of the root SVG element. If you want to turn this off then
set the overflow attribute to visible on the root SVG element:
overflow="visible"