Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Which route: PCL or GL/2

Status
Not open for further replies.

catskillmike

Programmer
Jan 19, 2012
4
US
I am trying to write a electronic forms package to replace one that has gone out of business. It will produce checks, invoices, purchase order, etc forms. We print mainly on HP 2000, 4000, 5000, 8000, 9000 series printers.

I have read the PCL 5 Printer Language Tech Ref manuals (Part I & II). We want to be able to draw boxes, lines, font, images. My problem and question is outlined on page 2-7 of the Part I manual.

At first GL/2 appeared to be a good route. But, GL/2 has an issue of a gutter of 150, where PCL has a gutter of 50. We need to get to the printable edge of the page (50). GL/2 can't get there. So, we moved back towards PCL which can get to the 50 mark. Our problem with PCL is that we cannot figure out how to change the thickness of the line of boxes and lines. In GL/2, it is easy. My question is: How do I over come one of the following:

1. Use GL/2 and get within 50 of the edge of the page?

2. Use PCL escape codes and change the thickness of the line of boxes?

We know it can be done, because the electronic forms package we are using now can do it.

One other question:

3. How do we write fonts, images, etc to a DIMM?
 
Use both PCL and HP-GL/2! Every form I make is done that way.

You can jump in an out of GL/2 from PCL.

A line in PCL is really just a filled rectangle, so change the narrow dimension to suit.

<esc>*c###a###bP

The value preceding the "a" is the width and that before the "b" is the depth. These values are in the current "unit of measure"

Why don't you examine one of your existing outputs to see how they achieved the margins.




Jim Asman
 
Jim, thanks for your reply. You certainly provided me with two alternatives. One that I had thought of, but dismissed as probably not workable.

I am already using both PCL and GL/2, but not as interactively as you have suggested. I do like your suggestion of positioning the X,Y coord in PCL, and then going into GL/2 to finish drawing the box in relative format. I think that will work. Something like this:

<esc>*p0X X-coord
<esc>*p0Y Y-coord
<esc>%3B Goto GL/2 with PCL X,Y and PCL system
IN; SP1; etc Initialize GL/2
PW.08; Set line width to 1/300
FT10,10; Fill 10% shaded box
ER100,300; Draw Relative box 100,300 dpi away from 0,0
<esc>%0A Exit GL/2

Not sure all the syntax and commands is correct. But, I think this general idea will work. Sort of fools the GL/2 system to print outside it's range.

I thought of using a white box within a black box, but didn't think this would work. But, I will have to try it. Maybe a second option. But, going into GL/2 appears to be a better option.

I had not thought of examining the spooler file and reverse engineering the code to see how they did it. I suppose I could turn off the printer and print to it. Then go into the Unix spooler and find the final output file. The existing SW pkg prints the form to a virtual printer, and then mixes in the output job from the application. Once everything is compiled up, it then sends it to the physical printer. I still have X-tree, so I can examine the hex output for the escape codes. I suppose the GL/2 code will be coded exactly as it was entered.

I will have to sit down and experiment with your ideas. If I have a problem, I will post again. I am sure I will have more questions and issues as I progress into the project.

Thanks for your very helpful suggestions. Greatly appreciated.
 
When I draw a box in PCL, I draw a black rectangle the size of the box., then a white rectangle just inside. Of course, that way you must put whatever in the box afterwards, not before.
 
I spent part of my day looking at the output file (from the out-of-business SW pkg) before it is sent to the HP printer.

All of the existing code was written in PCL. There is no GL/2 code. They did the black box with a white box laid inside of it to achieve the desired line thickness.

There were a couple surprises, and a few lines of code I didn't understand. But, I need to spend some more time with it.

I am making progress and learning.
 
The problem with drawing a white box inside the black one is that it precludes using the form as an 'automatic' overlay. As an overlay is laid on the page last thing before the page is run through the printer, any data that was to be printed inside the box would be erased by the overlay.

Jim Asman
 
... although it will work with a CALLed or EXECUTEd macro if the relevant sequence is included at the start of each relevant page.
 
I got some quiet time last night and I went through the code in more detail. They actually drew the boxes with lines. They indented the sides to get the box ends to look nice. That originally made me think it was a box-within-box. It is a little inefficient because it generates lots of code to send down the line to the printer. Okay on a fast network, but not so good if the printer is remote.

I think that I will probably get positioned with PCL and then jump into GL/2 to draw the box. This should be the most efficient. I may have to draw the box with lines if I used rounded corners. In that case I will draw the lines and use 90 degree radius corners.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top