• ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
  • ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
Guidelines
The HP Community is where owners of HP products, like you, volunteer to help each other find solutions.
Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
HP Recommended
HP Officejet PRO x476dn MFP
Linux

Greetings!

 

Can someone PLEASE help me!  From Window Photo Viewer I am printing an image (of a signature) to a file, which creates a PCL with PJL around it.  I would like to turn this into an overlay macro so that from my application in Linux I can print a form with the signature on it.

 

The job looks like this:

 

SC]%-12345X@PJL JOB
@PJL COMMENT MS PCLXL NT Driver
@PJL JOB NAME="Full page photo"
@PJL SET STRINGCODESET=UTF8
@PJL COMMENT "Prints to c temp print.pcl (0.3.7071.0); Windows 7 Professional 6.1.7601.1; Unidrv 0.3.7601.17514"
@PJL COMMENT "Username: reed; App Filename: Full page photo; 4-19-2016"
@PJL SET SMOOTHING=ON
@PJL DMINFO ASCIIHEX="0400040101020D101001153230313630343139313432313230"
@PJL SET PROCESSINGTYPE=PI_COVER_BACK
@PJL SET PROCESSINGOPTION=OFF
@PJL SET PROCESSINGTYPE=PI_COVER_FRONT
@PJL SET PROCESSINGOPTION=OFF
@PJL SET USERNAME="reed"
@PJL SET JOBNAME="Full page photo"
@PJL USAGE = CURI,8809,ea82,00,,02,01
@PJL SET PROCESSINGTYPE="IMAGE_SHIFT"
@PJL SET PROCESSINGOPTION="NONE"
@PJL SET PROCESSINGBOUNDARY=MOPY
@PJL SET DUPLEX=OFF
@PJL SET PROCESSINGTYPE="STAPLING"
@PJL SET PROCESSINGOPTION="NONE"
@PJL SET PROCESSINGBOUNDARY=MOPY
@PJL SET RET=MEDIUM
@PJL SET PRINTONBACKSIDE=OFF
@PJL SET RESOLUTION=600
@PJL ENTER LANGUAGE=PCLXL
) HP-PCL XL;2;0;Comment Copyright(c) 1999 Microsoft Corporation

 

A bunch of internal commands...

 

And the final line as:

[ESC]%-12345X

 

I used Notepad and inserted [ESC]&f1X0 right before the begining of the "internal commands" and then

[ESC]&f1X

[ESC]&f1y10X

[ESC]&f1y4X

before the [ESC]%-12345X (at the bootom), but I keep getting the "PCL XL Error, Subsystem: KERNEL, Error: IllegalTag" error message.

 

I have tried putting the macro commands in other places, but have had no luck!

 

Do you know what I need to do to make this work?

 

Thank you in advance,

Reed

 

59 REPLIES 59
HP Recommended

That won't work because your driver is producing a PCL6 job and you are adding PCL5 code. Maybe there is a PCL5

driver available that you will have better luck with. You might go to my website (removed solicited information) and grab a copy of the article I wrote on printing signatures.

 

HP Recommended

Great...Thank you for your input, Jim!

HP Recommended

Jim,

 

I downloaded a trial version of mkpcl and played with it yesterday.  Very easy to use and great instructions!

 

I followed the instructions and was able to convert my image and print it.  However, when I put [ESC]&f2y8X[ESC]&f2y0X at the begining and SC]&f1XSC]&f2y10X at the end, and call macro 2, I just get pages of garbage.

 

Do you think that also has to do with PCL5 vs. PCL6?  If so, what is the workaround?  I need to get this working soon so that I can purchase the product and convert our signatures for our forms.

 

Thank you,

Reed

 

 

HP Recommended

Pre-empting a reply from @Jim_Asman, I'd suggest that you should follow the example in his documentation, and use the '-m' parameter:

 

 

Capture.PNG

 

 

I assume that this:

 

  • ensures that the generated output does not contain PJL statements, or anything else that is not allowed within a PCL macro;  
  • encapsulates the generated PCL within the required macro control sequences (so you don't have to add them explicitly).

 

HP Recommended

Almost always on a Unix type system when you get pages of garbage, you need to add a "-o raw" flag to

your lp command. Without it the system adds characters into the print stream that messes up the LJ's

byte count and that is why you get garbage. It might very well be that you are corrupting the file when editing

it. On Linux, edit the file with "vim", the standard editor. Something like    vim -b sig.pcl  

 

Different editors can do bad things to you. Vim in binary mode (-b) IS user friendly. This may be your case

as you were able to print OK until you edited the file. Note that when you made the pcl file all of the macro

stuff could have been embedded eliminating the need for the edit to begin with. You would still need to add

the macro call inside the application data though.

 

Now if you were able to print a non macro image, that would suggest the printer supports PCL5. Do it this way.

 

Start with

 

<esc>E                   printer reset

<esc>&f1y8X      delete macro 1 if it exists

<esc>&f1y0X     begin macro 1 definition

Macro 1 data

.....

.....

.....

<esc>&f1X           end current macro definition, macro 1 coincidently

<esc>&f1y10X   make macro 1 permanent

 

<esc> E                  printer reset

 

Send this file to the printer. Nothing will print, but the printer will now contain the macro 1.

 

Run your application

 

<esc>E                   printer reset

All your printer setup stuff here

 

<esc>&f0S                         Save the current cursor address

<esc>*p1234x16522Y  Move to the printing position for the signatue

<esc> &f1y2X                   call macro 1

<esc> &f1S                         restore cursor

The rest of your application here

<esc>E                                 exit

 

Try the above and see how far you get and report back.

HP Recommended

Thank you...Yes, I used the -m option.  I didn't manually hand-enter the codes!

HP Recommended

Still no luck!  I entered the code that you provided, but I get garbage.  Here's what I did:

 

The image prints when it's just converted from BMP to PCL, using mkpcl.  It prints fine with the "-o raw" option.

 

Then, I converted it with the -m -p options to create a macro.

 

I directed it to the printer: "lp -dlp912 < macro.pcl"  (I even tried "lp -o raw -dlp912 < macro.pcl" with the same outcome)

 

Then I executed a small PCL that just prints some text and expected the image to print too, but garbage printed:

 

[esc]E[esc]&f0S[esc]*p1234x16522Y[esc]&f2y2X[esc]&f1S[esc]&k0G[esc](8U[esc](s0p10h10v3b0s3T[esc](s0p15H[esc]&a1940v1540HThis is a test[esc]&a2040v1540HAnother test![esc]&k0G[esc](8U[esc](s0p12h10v3b0s3T[esc](s0p15H[esc]&a5860v220HSome test

 

I also put [esc]E at the begining and the end, but it made no difference.

 

HEEEEEEELP 🙂

 

HP Recommended
What I'd try next is to concatenate your macro file and the file of test PCL sequences into a new file, then send the content of this new file (using the '-o raw' option) to the printer.

Does this work?
HP Recommended
Unless it's a typo, your vertical cursor position of 16522 equates (at the default 300 units per inch) to over 55 inches!
I haven't checked any of the other sequences yet.
Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the <a href="https://www8.hp.com/us/en/terms-of-use.html" class="udrlinesmall">Terms of Use</a> and <a href="/t5/custom/page/page-id/hp.rulespage" class="udrlinesmall"> Rules of Participation</a>.