0

I am trying to generate PCL files for an HP printer and my text is getting a strange indentation. For example, if I have code like this:

<esc>%-12345X
<esc>E
<esc>&l2A
line 1
line 2
line 3
<esc>&l1T
<esc>E
<esc>%-12345X

Then I get output like this:

line 1
    line 2
        line 3

Why is this happening?

Erik A
  • 31,639
  • 12
  • 42
  • 67
Tyler Durden
  • 11,156
  • 9
  • 64
  • 126
  • First of all.. PCL 3,4,5,6?? Second of all.. what I did when i was writing PCL5 drivers was find a generic(ish) version of a driver that worked well (HP500?), print to file, and look at it in a hex editor. If you are planning on writing PCL, you are better off making your own user mode mini port driver using the DDK. The PCL5 example works right out of the box with NO modification. – Señor CMasMas Mar 07 '19 at 15:32

1 Answers1

0

This is most likely relates to CR not being sent with LF in the output from your program at the end of each line.

You might look to see what kind of line endings your code will output, LF or CR-LF. You want the latter. On some HP LJ printers, you can go to the Printing settings and the PCL menu, and turn on an "append carriage return to line feed" setting on the printer.