how to get the PageFormat from a Java.awt.print.PrinterJob
Posted
by Alex
on Stack Overflow
See other posts from Stack Overflow
or by Alex
Published on 2009-04-26T18:13:23Z
Indexed on
2010/04/20
12:03 UTC
Read the original article
Hit count: 143
Hi, I'm trying to use the PageFormat information to modify my javax.swing based printout prior to printing it. I am stumped as to how I can get the PageFormat from the PrintJob (which is obtained using getPrinterJob() and printDialog()). I know there is the getPageFormat method, but I can't figure out how to get the PrintRequestAttributeSet (which is not the printJob.getPrintService().getPrintAttributes()). Honestly, all I really want to know is the width and height of the page. Any ideas on how I can do that? Thanks.
© Stack Overflow or respective owner