• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem printing multi page with Jpanel

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
------------------
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic