Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Inserting a PCL string in java Document for paper source control

807603Dec 4 2007 — edited Dec 4 2007
Got a printer issue here.

I need to set the source printer tray from within the document using PCL because I am printing to a network printer and the driver that is being used always defaults the source tray to the printer default.

I am inserting the String right at the beginning of the document like so:
document.insertString(0, "\u001B&l2H", null);

The "\u001B" is the ASCII escape character used by the control sequence and the "&l2H" is the PCL code for the Manual tray. This does insert the string into the document but when the ,prn file is created (print to file) it does not use the inserted value.

The document type is text/html and I am 'Printing to file' using:
aJobAttrs.add(new javax.print.attribute.standard.Destination(new java.net.URI("file:///C:/temp/out.prn"))); as suggested in another forum. The .prn file that is persisted however still sets the tray to the printer default (&l7H).

Anyone go any suggestions?

Ps The MediaTray.MANUAL does not work because the network print driver overwrites it.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 1 2008
Added on Dec 4 2007
2 comments
453 views