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 grillot sebastien <se...@gmail.com> on 2005/07/06 11:42:27 UTC

out printing a svg file

Hello,
i want to out print my svg file (that is contain on my canvas) but
when i do this :
public static void main(String args[]) throws ClassNotFoundException {

		Canvas aCanvas = new Canvas();
		BufferDoc aDocBuffer = new BufferDoc(aCanvas.getDocument());
		System.out.println(aDocBuffer.getBufferDoc(new Integer("0")));
		SVGGraphics2D g = new SVGGraphics2D(aCanvas.getDocument());

		Shape circle = new Ellipse2D.Double(0, 0, 50, 50);
		g.setPaint(Color.BLUE);
		g.fill(circle);

		Element root =
aCanvas.getDocument().getDocumentElement();//doc.getRootElement();
		g.getRoot(root);
		aDocBuffer.setBufferDoc(aCanvas.getDocument());

//aDocBuffer.getBufferDoc() return a document
		System.out.println(aDocBuffer.getBufferDoc(new Integer("0")));

	}

i have this on my console :
org.apache.batik.dom.svg.SVGOMDocument@12a3722
org.apache.batik.dom.svg.SVGOMDocument@12a3722


but i want the dom tree (.... it's the good name ?)

Regards

seb

-- 
Regist. Linux User #344952

/* Fuck me gently with a chainsaw... */
  -- 2.0.38 /usr/src/linux/arch/sparc/kernel/ptrace.c

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


Re: out printing a svg file

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Sebastien,

    Well I don't know most of the classes mentioned
in your example (what is Canvas? what is BufferDoc?).
The getRoot class should simply append the graphical content to
root (BTW it's possible that the document has no root element
which would mean that you are passing in null to getRoot in
which case I think getRoot would construct it's own root to
append to, which it returns - and you don't capture).

grillot sebastien wrote:

> i want to out print my svg file (that is contain on my canvas) but
> when i do this :
> public static void main(String args[]) throws ClassNotFoundException {
> 
> 		Canvas aCanvas = new Canvas();
> 		BufferDoc aDocBuffer = new BufferDoc(aCanvas.getDocument());
> 		System.out.println(aDocBuffer.getBufferDoc(new Integer("0")));
> 		SVGGraphics2D g = new SVGGraphics2D(aCanvas.getDocument());
> 
> 		Shape circle = new Ellipse2D.Double(0, 0, 50, 50);
> 		g.setPaint(Color.BLUE);
> 		g.fill(circle);
> 
> 		Element root =
> aCanvas.getDocument().getDocumentElement();//doc.getRootElement();
> 		g.getRoot(root);
> 		aDocBuffer.setBufferDoc(aCanvas.getDocument());
> 
> //aDocBuffer.getBufferDoc() return a document
> 		System.out.println(aDocBuffer.getBufferDoc(new Integer("0")));
> 
> 	}
> 
> i have this on my console :
> org.apache.batik.dom.svg.SVGOMDocument@12a3722
> org.apache.batik.dom.svg.SVGOMDocument@12a3722
> 
> 
> but i want the dom tree (.... it's the good name ?)
> 
> Regards
> 
> seb
> 


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