xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bishop, Michael W. CONTR J9C880" <Michael.Bis...@je.jfcom.mil>
Subject RE: Strange problem when printing
Date Wed, 12 Oct 2005 20:34:01 GMT
Nevermind, I came across it in the Javadocs;
DOMUtilities.deepCloneDocument(...) for those interested.

Michael Bishop

-----Original Message-----
From: Bishop, Michael W. CONTR J9C880
[mailto:Michael.Bishop@je.jfcom.mil] 
Sent: Wednesday, October 12, 2005 4:27 PM
To: batik-users@xmlgraphics.apache.org
Subject: RE: Strange problem when printing


>   The easiest thing to do is to simply clone the document before you
> go to print it.  However if you want to you can probably use the
> graphics tree from the Canvas to draw to the print Graphics2D.

What's the suggested way to clone a document?  Running into the same
kind of issue with transcoding a document to PNG/JPG.

Michael Bishop


-----Original Message-----
From: Thomas DeWeese [mailto:Thomas.DeWeese@Kodak.com] 
Sent: Tuesday, October 11, 2005 7:02 AM
To: batik-users@xmlgraphics.apache.org
Subject: Re: Strange problem when printing

Hi Henric,

henric wrote:
> When I call the print-function of the PrinterJob-class, it somehow
seems
> to break the SVG loaded in the JSVGCanvas:
> 
>   TranscoderInput ti = new
> TranscoderInput(SvgEditor.getCanvas().getSVGDocument());
>   prm.transcode(ti, null);

   A document can only be associated with one graphics tree at a
time.  When you 'print it' the association between the document
and the Canvas is broken and it is reassociated with the print
transcoder.

> After having printed the SVG (Which works like it should) all changes
I
> try to do to the SVG generates a NullPointerException. 


> Oh, and another problem I have: How do you get the scrollbars in the
> JSVGScrollPane to update themselves and correct the scrollbars?

   They should do this automatically.

> When I load a new SVG and then add some elements to it that stretches
> outside the visible area, it doesnt update the scrollbars. But as soon
> as I press an arrow-key, it shows the scrollbars like it should. 

   Are you taking care to only update the Document in the
UpdateManager's RunnableQueue thread?  It doesn't look like it:

>  at org.apache.batik.dom.AbstractElement.setAttribute(Unknown Source)
>  at JSvgCanvasEnh.setZoom(JSvgCanvasEnh.java:75)
>  at StandardToolbar.actionPerformed(StandardToolbar.java:225)

   If you just modify the Document "Bad things" will happen, you
must only modify the document in the UpdateManager thread.

> I've tried calling m_canvasScroll.reset(); in the OnLoadAction-method 
> that's executed when an SVG is loaded into the canvas, but it doesn't 
> seem to do anything.

   Make your changes in the UpdateManager thread and all should be
well...


---------------------------------------------------------------------
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

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


Mime
View raw message