Thank you for the suggestions, Peter.
And I recall using this reset-character-sending technique in the past, so thank you for the reminder!
Original Message:
Sent: 12-05-2023 02:38
From: Peter Cheney
Subject: PRINT statements and escape sequences (PCL)
Hey Shawn, when messing with PCL escape codes, it is always good practice to first send an ESC:'E' to reset the printer. Then you can squirt in your desired combo of configurations followed by the job data and lastly followed by another ESC:'E' to reset and print the last page.
The reason the printer is printing the s12 and not interpretting it as a PCL command might be because the printer cannot deal with that option in its current state. Resetting it beforehand should do the trick.
Also there's a nice little feature in the UV spooler (in unix) that allows you to cat a file to standard-in and standard-out effectively wrapping the print job in a header and footer. In these files you can place PCL commands, assign the files to a print queue and each time you print to that queue you get that particular PCL configuration sent to the printer for each job. Easy to then write a maintenance routine to set the files to do portrait/landscape, font stuff and the like.
Hope this helps
Cheers
------------------------------
Peter Cheney
Developer and Systems Superstar
Firstmac
Brisbane Qld Australia
Original Message:
Sent: 11-29-2023 16:19
From: Shawn Waldie
Subject: PRINT statements and escape sequences (PCL)
I'm attempting to adjust the pitch to 12 characters per inch so the invoice number (green box) will fit within the designated column:
![](https://higherlogicdownload.s3.amazonaws.com/ROCKET/MessageImages/601ac8f96deb4cc1b8bd02136a7c9b27.png)
However, the output is not affected, and the HP printer just passes the code through as if it is text to be printed (yellow box).
I'm using the following code with the intention of every subsequent print statement resulting in text that is 12 chars/in.
X.ESC = CHAR(27)
X.PCL.COMMAND = X.ESC:"(s12H"
PRINT X.PCL.COMMAND
Does anything need to be enabled on the printer (hp4350) for PCL commands to take effect?
The printer in question will generate a PCL font list so I think that confirms the required software is present.
Also, does every print statement have to include the escape sequence or can it just be invoked once and remain in effect until the page/job is finished?
It's been 10+ years since I messed with this (at another site), but I don't recall having any trouble with it.
------------------------------
Shawn Waldie
enterprise application developer
Rocket Forum Shared Account
Los Angeles CA US
------------------------------