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 Paul Willems <pw...@piscescom.com> on 2003/07/23 08:03:40 UTC
Multiple page printjob
Batik 1.5
JDK 1.4.1
Win XP
When I pass on an array of pages to this method, the result is a
printjob that apparently only has 1 page. It prints each SVG on a
separate page, but in the printer dialog I only get "Print pages: 1 of
1". I would like to be able to specify which pages I want to print in
the same way I would for any other document. Any ideas?
public void printPages(String[] pages)
{
PrintTranscoder p = new PrintTranscoder();
TranscoderOutput output = new TranscoderOutput();
try
{
TranscoderInput[] inputs = new
TranscoderInput[pages.length];
for (int i = 0; i < pages.length; i++)
{
inputs[i] = new TranscoderInput(toURI(pages[i]));
p.transcode(inputs[i], output);
}
p.addTranscodingHint(p.KEY_SHOW_PRINTER_DIALOG,
Boolean.TRUE);
p.print();
}
catch (Exception ex)
{
ex.printStackTrace(System.out);
}
}