This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PageFormat and PrintRequestAttributeSet

 
marwen Bakkar
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please explore it more.
 
marwen Bakkar
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any suggestions?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic