Search code examples
javaswingprintingjframegraphics2d

Print JFrame by splitting to multiple pages


I want to print JFrame by breaking it into parts and printing each part on each page by zooming the part.

Suppose the JFrame is of size 100x100. Then I want to divide the JFrame into cells each of size 20*50. So I will be having 20 cells. I want to magnify or zoom the parts and print them each on different page.

Anybody having any ideas about how to do it?


Solution

  • You may be able to adapt one of the approaches examined in Tutorials & Code Camps Chapter 6 Continued: Advanced Printing, which covers several related topics:

    • Multiple Components Per Page
    • Components Larger Than One Page
    • Printing a JTable Component
    • Printing a Sales Report