Hi Diego,
Diego de Felice <[email protected]> wrote on 11/02/2009 04:16:38
AM:
> Hi to all, some time ago I discovered that Batik was not able to
> support multi-page printing with the PrintTranscoder. This resulted
> in the impossibility to print with Java more than one SVG file on
> different page in the same print job.
Are you aware that you can call 'transcode' more than once on
the PrintTranscoder? If you do that then it will record the documents
and 'play them back' during the print phase.
> Change all the method with this one:
> public int print(Graphics _g, PageFormat pageFormat, int pageIndex){
> pageIndex = curIndex+1;
This is very wrong. The same pageIndex may be used multiple
times in a row (for some outputs it renders the document in strips
and in these cases it will request a print of the same page dozens
of times).
Is it really the case that when printing a book the pageIndex
doesn't start at zero for the second and later PrintTrascoder's
'print' calls?
If that is the problem then the right fix would be to be able
to set a 'base page' for a PrintTranscoder. Then this 'base'
could be subtracted from the 'pageIndex'.
> Book _book = new Book();
> _book.append(t, pf);
> _book.append(t2, pf);
> job.setPageable( _book );
> job.setCopies(1);
> job.print();