chunkII123
IS-IT--Management
Alright, this seems to be an easy one for a programmer with more skill than I. Here is what I have -
The block that it prints is 400 pixels wide, but it prints roughly (.250", .250" (x, y respectively)) on the page. I would like to center it on the x axis, and it looks as though my printable area is (640, 797), so essentially I need to set the location of the print page to (120px, (pixel resolution of a quarter inch)).
Thanks ahead of time.
-Josh
Beware of hackers bearing executables. Happy Hunting. 'irc.2600.net'
Code:
public void print() {
PrintUtilities printUtil = new PrintUtilities(this.getContentPane());
PageFormat myPageFormat = new PageFormat();
myPageFormat.setOrientation(PageFormat.PORTRAIT);
Paper paperType = new Paper();
paperType.setImageableArea(600.0, 750.0, 625.0, 792.0);
myPageFormat.setPaper(paperType);
printUtil.setPageFormat(myPageFormat);
printUtil.setPageSize(.95, .95);
printUtil.setPrintJobName("Problem Members");
this.setVisible(false);
JOptionPane.showMessageDialog(this, "Problem Members Printed.", "Problem Members", JOptionPane.INFORMATION_MESSAGE);
// this try block does not execute
// print comes from the printutil method of the matchedmembers form
}
The block that it prints is 400 pixels wide, but it prints roughly (.250", .250" (x, y respectively)) on the page. I would like to center it on the x axis, and it looks as though my printable area is (640, 797), so essentially I need to set the location of the print page to (120px, (pixel resolution of a quarter inch)).
Thanks ahead of time.
-Josh
Beware of hackers bearing executables. Happy Hunting. 'irc.2600.net'