-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
- HP Community
- Archived Topics
- Printers Archive
- Turning a PJL to a PCL macro

Create an account on the HP Community to personalize your profile and ask a question

04-19-2016 09:10 AM
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:
[ESC]%-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
04-19-2016
11:10 AM
- last edited on
04-19-2016
11:17 AM
by
Duane_D
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.
04-20-2016 08:42 AM
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 [ESC]&f1X[ESC]&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
04-20-2016 10:39 AM
Pre-empting a reply from @Jim_Asman, I'd suggest that you should follow the example in his documentation, and use the '-m' parameter:
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).
04-20-2016 10:42 AM
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.
04-20-2016 02:07 PM
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 🙂
