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 th...@kodak.com on 2007/10/25 12:41:14 UTC

Re: doc importing

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"