I am trying to set a custom paper size using printer jobs but it does not take
my custom paper size and instead it takes the default paper size. The code I am
using is as follows:
PageFormat pageFormat = job.defaultPage();
Paper paper = new Paper();
paper.setSize(500,500); // Large Address Dimension
paper.setImageableArea(20, 20, 450, 420);
pageFormat.setPaper(paper);
pageFormat.setOrientation(PageFormat.PORTRAIT);
try {
job.setPrintable(this,pageFormat);
if (job.printDialog()) {
job.print();
}
} catch (PrinterException e) {
e.printStackTrace();
}
What am I doing wrong?
[Message sent by forum member 'lucho01' (lucho01)]
http://forums.java.net/jive/thread.jspa?messageID=241224
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".