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/12/07 11:32:31 UTC

Re: Printing Questions

Hi Michael,

"Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> wrote on 
11/27/2007 09:04:04 AM:

> 1.  How do I print a document that isn't saved on disk? If I'm 
> working on something in-memory how do I print it?  I currently save 
> it "behind the scenes" to a temporary directory and print it. 
> Otherwise, I get an "Unexpected End Of File", even if I set the base
> URI for the document.

   Give the document to the constructor of your TranscoderInput.
If the Document is associated with another rendering (like say the
canvas) than weird things might happen (in which case you should
clone the document in memory).

   Otherwise if you are getting an error this way it's probably a 
bug.  When/where does that exception occur?  Can you provide a stack 
trace?

> 2.  How do I print multiple documents at once?  I have a collection 
> of SVG documents, each representing a page.  If a user wants to 
> print all the pages or a range of pages, is there a way to send a 
> set of pages to a PrintTranscoder?  Currently I print each one 
> separately in a loop that only prompts for the print dialog on the 
> first iteration.

   For the PrintTranscoder (and currently only the PrintTranscoder)
you can call the 'transcode' method multiple times and it will 
'remember' the documents until you call the 'print' method.