wood burning stoves*
The moose likes Java in General and the fly likes PageFormat and PrintRequestAttributeSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "PageFormat and PrintRequestAttributeSet" Watch "PageFormat and PrintRequestAttributeSet" New topic
Author

PageFormat and PrintRequestAttributeSet

marwen Bakkar
Ranch Hand

Joined: Jan 28, 2010
Posts: 84
Hi,

What I want to achieve is the following:

Three buttons : Print Setup, Print Preview and Print.

When clicking on Print Set Up, it opens the dialog which that has all the printing settings.

Once i am done with the setup, i can opt for print OR print preview or both one after another.

Currently it is not possible to create a PrintRequestAttributeSet using a PageFormat instance. Which means that if i am going to preview an image I have to define the page layout in two different locations. One for previwing and one for printing. Or am I wrong?
Ankit Tripathi
Ranch Hand

Joined: Oct 17, 2009
Posts: 198
please explore it more.
marwen Bakkar
Ranch Hand

Joined: Jan 28, 2010
Posts: 84
I use pageFormat = printJob.pageDialog(pageFormat) to display the page layout dialog and let the user choose his setts. The PageFormat returned is later used to display a print preview dialog. My problem is how to construct a PrintRequestAttributeSet based on this PageFormat instance so if a print operation is requested it is performed with those setts. Does that make sense?
marwen Bakkar
Ranch Hand

Joined: Jan 28, 2010
Posts: 84
Any suggestions?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: PageFormat and PrintRequestAttributeSet