Skip to main content
Shawn Waldie
Nov 29, 2023 4:20 PM UTC

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:

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
------------------------------

    11 replies

    Shawn Waldie
    Feb 9, 2024 12:32 PM UTC

    I have run into similar issue and it came down to the defined printer driver modifying the pcl commands being sent.  Try defining the printer as a generic text or raw (as opposed to a HP driver) and see if it resolves your issue.  You typically can define multiple queues with different drivers going to the same physical printer to handle the various types of jobs.



    ------------------------------
    doug miller
    dir tech services
    Rocket Forum Shared Account
    Carrollton TX US
    ------------------------------

    I can finally confirm that this worked.
    Though I couldn't get two other options to work (with 'generic' in the name),  one labeled 'Local Raw Printer (grayscale)' did the trick.

    Thank you!

    And a big thank you to everyone else who offered very helpful feedback.



    ------------------------------
    Shawn Waldie
    enterprise application developer
    Rocket Forum Shared Account
    Los Angeles CA US
    ------------------------------