Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem printing multi page with Jpanel

 
steven s
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I try to print a multi page document.
Each document is a JPanel wich extends printable.
In the print dialog there is eg 4 pages, but when I click ok to send the job to the printer, only the first page will be printed.
If I replace the Jpanel to a normal text site, it works well.
Does anybody have experience in printing JPanel's ?
Here is the Code of the print routine:
Book book = new Book();
for (int i = 0; i < 4; i++)
{
Paper paper = new Paper();
paper.setSize(595, 842); // A4 (in Point)
paper.setImageableArea(0, 0, 595, 842); // ganze Seite f�r Druck nutzen
PageFormat pf = new PageFormat();
pf.setPaper(paper);

ImagePanelPrint myImgPanel = new ImagePanelPrint(i,pf);
//SPecial printable JPanel
book.append(myImgPanel, pf);
}
printer.setPageable(book);
if (printer.printDialog())
{
try
{
printer.print();
}
catch (Exception PrintException)
{
PrintException.printStackTrace();
}
}
On the JPanel is a view of some SVG Shapes from my own SVG viewer.
Thanks a lot for help
Steven
------------------
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic