This discussion is archived
0 Replies Latest reply: Feb 11, 2013 9:07 AM by 811100 RSS

Error printing envelope

811100 Newbie
Currently Being Moderated
I've been having an issue printing an envelope using PrintRequestAttributeSet and was curious if anyone else has had an issue related to this. My printing works fine when printing envelopes on all other printers except for one. The printer having an issue is a Xerox WC 7556. For some reason when I try to print using a MediaSize of NA_NUMBER_10_ENVELOPE the printer gives an error that says "The Job was deleted due to a Paper Type and/or Paper Size selection within the job that cannot be printed face up.". The strange thing is that it doesn't work when the defaults are set using Java, but if the user selects Tray 1 manually through the print dialog it works just fine. Here is the basic code that I'm using.
PrintRequestAttributeSet requestAttributes = new HashPrintRequestAttributeSet();
MediaSize mediaSize = MediaSize.getMediaSizeForName(MediaSizeName.NA_NUMBER_10_ENVELOPE);

float mediaHeight = mediaSize.getX(MediaSize.INCH);
float mediaWidth = mediaSize.getY(MediaSize.INCH);
float leftMargin = .25f;
float topMargin = .25f;
float printableWidth = mediaWidth - (leftMargin + leftMargin);
float printableHeight = mediaHeight - (topMargin + topMargin);
requestAttributes.add(new MediaPrintableArea(leftMargin, topMargin, printableHeight, printableWidth, MediaPrintableArea.INCH));
The only thing that really comes to mind is that Xerox No. 10 envelope is 4.1 x 9.5 and the defined envelope in Java is 4.125 x 9.5. Has anyone encountered something like this before?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points