Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplex printing in PCL 5e and PCL 6 1

Status
Not open for further replies.

popalu

Programmer
Apr 8, 2004
31
GB
Hi, I am quite experienced in PCL programming though I have come up against a problem which is probably easy to resolve once you know what you're looking for. I have just bought a HP9000 Duplex printer and can print through Windows in duplex, but printing through the ESC codes, I cant get the printer to print duplex.

When I send the command at the start of the code to print my duplex document, do I send a feed$ after each side, after both sides are sent? If I send a feed after page one and page two I get two pages printed, front and back, if I send only one feed after the second page I get both sides on the same page. Is there a command I am missing?

I didn't get a manual with the machine so don't know if I am missing an important ESC code other than ESC&l1S.

E$= esc
lprint e$;"E";e$;"&l1O"; ' reset/portrait
lprint e$;"&l0L"; ' disable perf skip
lprint e$;"&l0E"; ' set top margin to 0
lprint e$;"&l1X"; ' copies
lprint e$;"&l1S"; ' duplex
 
If I send a feed after page one and page two I get two pages printed, front and back".

Isn't that what you are trying to achieve (i.e. duplex)?
 
Sorry, this is not clear, I get page one ejected and then page two ejected, in affect two pages not one page with side 1 and side 2 on one sheet.

I have to feed the sheet through twice using this methed to get a proper duplex page
 
What I am after is
I set the mode to duplex
laydown my text for side 1

1. send a page feed
laydown text for side 2
send a second page feed

or

2. laydown text for side 2
send first page feed only

Am I missing a command, as I either get two pages printed with the side 1 on one sheet and side 2 on one sheet or I get one sheet with the text for sides 1 and 2 on the same page.

This is very difficult to explain.
 
To set duplex mode on, use
<esc>&l1S
where <esc> is the character with decimal code 27 (hexadecimal 0x1b)

You already appear to be setting this.

Thereafter, to print ALL pages in duplex mode, you would have a sequence of:
sheet 1 front face data
form-feed (0x0c)
sheet 1 rear face data
form-feed (0x0c)
sheet 2 front face data
form-feed (0x0c)
sheet 2 rear face data
form-feed (0x0c)
etc.

If you are already doing this, and the data always prints on the front face only, this might imply that your printer does not have a duplex unit, or that the unit is disabled (some printers disable the duplexer if the rear output path is opened).

As an alternative to FormFeed (and to give more control), you could use the 'Duplex Page Side Selection' sequence:
<esc>&a#G
where:
# = 0 Select next face
# = 1 Select front face
# = 2 Select rear face
 
Since I'm using SQR to print DUPLEX maybe the correlation here might be the same:
1. After setting a variable like DUPLEXon to ON <27>&l1S or....DUPLEXoff to off <27>&l0S using either print or encode statement, I usually put the OFF variable first before the ON variable in the beginning of the program. This way since the program is a cycle, it will turned ON on odd pages and off on even pages.

 
Here's more explanation on why I have to turn OFF the duplexing before turning it ON. Everytime you turn duplexing off that means you are resetting which side the printer is currently on. The printer does not know which side is which(topside or underside). When you turn ON duplexing, it tells the printer that the next page is the underside. If you don't turn this OFF it will continue to be in the underside position.
 
Will try these suggestions and see if they work, Duplex page Selection looks interesting. Cheers for the help. Will let you know if I sort the problem with these suggestions.
 
Just a words of caution. When dealing with duplex printing make sure that you know when the printing supposed to go to the next page. This way you will avoid extra pages being spitted out of the printer.

Usually you may just do plain printing and let all printer defaults do it's job. But when you control most of the printer behavior like newline, page size, number of lines, headers and footers, font sizes etc, the whole representaion of the entire text in a page is now different. Conflict will arise specially in controlling new page.
 
Thanks. I got it working with the following

<esc>&a#G

# = 0 Select next face
# = 1 Select front face
# = 2 Select rear face

Send the front side command, then data to print on the front
Send the rear side command, then data to print on the rear
Then form feed and it all works.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top