I need to convert a valid PCL printer file to an automatic form overlay on a FreeBSD platform using CUPS and ghostscript to handle printing. The instructions respection PCL overlays that I have found evidently require a great deal more familiarity with PCL than I possess or have time to acquire.

My present understanding to create an AO marco one prefaces and appends special instructions to the desired PCL code:

<esc>&f0X                               # start of macro definition

<pcl code here>                         # macro definition

<esc>&f22y1X                            # end of macro definition id=22
<esc>&f22y10X                           # make macro permanent until printer reset

To use the macro one prefaces the desired base document file with:

<esc>&f22y4X                            # activate OA macro id=22

The macro created is given with an index number between 0 and 65536. The call to the macro must be placed at the start of the PCL data stream referencing the desired macro id.

This I can follow. What I cannot seem to get straight is what parts of the PCL print file need replacing to turn it into a working PCL macro.

I created a test AO form in LibreOffice draw and printed it to a file using a hpcups_3 virtual printer. The resulting disk file contains this:

<esc>&l7h0m2a0s8c0o0E<esc>*o0M<esc>&u600D<esc>*t600R<esc>*r4800S . . . <null><null>ú<null><ff><esc>*rC<esc>E<esc>%-12345X

I know that the @PCL lines have to go. My question is what other removals are required before putting in the macro definition commands? This attempt does not seem to work for me.

<esc>&l7h0m2a0s8c0o0E<esc>*o0M<esc>&u600D<esc>*t600R . . . <null><ff><esc>*rC<esc>E<esc>%-12345X

It seems to me that the sequences <esc>E<esc>%-12345X and <esc>E<esc>%-12345X have some sort of delimitation purpose. Should the converted file look like this instead?

<esc>&l7h0m2a0s8c0o0E<esc>*o0M<esc>&u600D<esc>*t600R . . . <null><ff><esc>*rC

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.