INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Sample/Information for PCL or PJL line/box drawing (HP Laserjet)
2

Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

(OP)
I'm working on a project and need info on box drawing and line drawing
in PCL or PJL for HP Laserjet 4350 series printers. We need to manually code
to fit custom forms and data.
Samples would be great. I have found the PJL code PD, PU and SD but need to know the
parameters.
Thanks

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

I do this all the time.

Simply get the PCL5 technical reference, and read up on the rectangle codes
in the form <esc>*c####a####b0P where the value before the a is the width and
that before the b is the depth of the rectangle. The values are in user units,
typically 300 dpi.

So a horizontal line 3 inches wide would be <esc>*c900a5b0P while a vertical line
3 inches high would be <esc>*c5a900b0P. If you properly position the cursor,
four lines can be positioned so as to reate a box. Adjust the small number for
a thinner or bolder line.

Much of this is easier is HP-GL/2 which is also covered in the reference.



Jim Asman
http://www.spectracolorservices.com

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

(OP)
Hi Jlasman;

Followed your instructions and I have the top, bottom and left vertical.
Can't seem to reposition the row/column to perform the right vertical line.

I have four rectangles that need to be made horizontally.
Here's my sample code:
0022: print hp.default.page:hp.eol
0023: *
0024: * Top Horizontal Line
0025: print hp.esc:char(42):char(99):'600':char(97):'5b0':char(80)
0026: *
0027: * Reposition for Vertical
0028: print hp.esc:char(42):char(112):'0':char(120):'145':char(89):hp.eol
0029: * Vertical Line
0030: print hp.esc:char(42):char(99):'5a':'300':'b0':char(80)
0031: *
0032: * Reposition for Bottom Horizontal Line
0033: print hp.esc:char(42):char(112):'600':char(120):'450':char(89):hp.eol
0034: * Bottom Horizontal Line
0035: print space(3):"Where am I ?"
0036: print hp.esc:char(42):char(99):'600':char(97):'5b0':char(80)
0037: * Reposition for Right Vertical Line
0038: print hp.esc:char(42):char(112):'500':char(120):'600':char(89):hp.eol
0039: print hp.esc:char(42):char(99):'5a':'300':'b0':char(80)
0040: * Write it out
0041: print hp.esc:char(69):hp.eol

Note: hp.esc=char(12), hp.eol=char(13):char(10)

Thanks,

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

Other than the <esc> the rest is all ascii. So it looks as though you want a box that is 600 pixels wide by 500 pixels high do this...

hp.esc:"*c600a5b0P" #Draw Top Horizontal line
hp.esc:"*c5a500b0P" #Draw Left vertical line
hp.esc:"*p+600x+500Y" #Position cursor to the bottom right of box relative move
hp.esc:"*c-5a-500b0P" #Draw right vertical up. Note the minus signs
hp.esc:"*c-600a-5b0P" #Draw bottom line to left Note minus signs
hp.esc:"*p-600x-500Y" #Return cursor to origin at top left

There is only one cursor move in the drawing of the box and a traiing one
at the end to restore the origin.

I'm not sure of yor language, so perhaps the double quotes " need to be singles '
I assume that hp.esc delivers char(27).

In HP-GL/2, that box could be done with ER600,500; and without any cursor move

Jim Asman
http://www.spectracolorservices.com

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

(OP)
Hi Jlasman;

Thanks for the info.. I entered the info as presented but the result gave me a
horizontal line and a left vertical line, then another lower horizontal line (with a few
<lf> and another left vertical line.

This is the problem that I have been encountering. It doesn't seem to be recognizing
the row and column (x/y) positioning.

I will need to have the rectangles, 750 x 300, on a horizontal plane with line drawing below it.

Current result:
-----------------------------
|
|
|
|

-----------------------------
|
|
|
|

Thanks,,

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

But your cursor positioning seems to be to an absolute address with the origin at 0x0y rather than an address relative to the origin that is somewhere else on the page.. It is awfully hard to interpret your code when you don't directly display the ascii characters. Perhaps you could post the actual PCL the your code is generating and then we could tell exactly is going on.

Did you try the method in the pseudo code that I posted?

Jim Asman
http://www.spectracolorservices.com

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

(OP)
Hi Jlasman;

Here's the output captured (ignore the line numbers):
0001:
0002:
0003:
0004: ^027E
0005:
0006: ^027&l1O
0007:
0008: ^027&l5.45C
0009:
0010: ^027*c600a5b0P
0011: ^027*c5a500b0P
0012: ^027*p+600x+500Y
0013: ^027*c-5a-500b0P
0014: ^027*c-600a-5b0P
0015: ^027*p-600x-500Y
0016: ^027E

Here's the code:
0019: hp.esc=char(27)
0020: print hp.esc:char(69):hp.eol ; * Reset
0021: print hp.landscape.mode:hp.eol
0022: print hp.default.page:hp.eol
0023: *
0024: print hp.esc:"*c600a5b0P" ; * Draw Top Horizontal Line
0025: print hp.esc:"*c5a500b0P" ; * Draw Left Vertical Line
0026: print hp.esc:"*p+600x+500Y" ; * Position Cursor to bottom Right of box (Relative)
0027: print hp.esc:"*c-5a-500b0P" ; * Draw Right Vertical Up (Minus Sign)
0028: print hp.esc:"*c-600a-5b0P" ; * Draw Bottom Line to Left (Minus Sign)
0029: print hp.esc:"*p-600x-500Y" ; * Return Cursor to Origin at Top Left
0030: print hp.esc:char(69):hp.eol

Thanks

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

I apologize. You cannot draw a line up or to the left in PCL. You can in HP-GL/2.

This means that we have to visit a 3 of the 4 corner positions of the proposed box. Attached is a printable file. But lets go through it.

<esc>"*p500x500Y" #Initial position
<esc>"*c600a5b0P" #Draw top line
<esc>"*c5a500b0P" #Draw left line
<esc>"*p+500Y" #Move to bottom left corner
<esc>"*c600a5b0P" #Draw Bottom line
<esc>"*p+595x-500Y #Move to top right
<esc>"*c5a500b0P" #Draw Right line
<esc>"*p-595X #Return to origin

Note the the move to the right side was only 595 and not 600. This is to position the verttical line there inside the top and bottom line. In fact the vertical move dhould have only been 495 if our box size was to include the the thickness of the lines themselves.

If yours doesn't work compare your pcl to the attached file that WILL print properly.

Carry on!

Jim Asman
http://www.spectracolorservices.com

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

There is a shorter way to create a box in PCL. Basically we draw a solid black box to the desired dimension. Then move the cursor inside that box 5 pixels each way and then draw an appropriately smaller "white" box that erases the interior of the big black box, leaving the outside 5 pixel perimeter 5 pixels. So ...

<esc>"*p500x500Y" #Initial position
<esc>"*c600a500b0P" #Draw big black box
<esc>"*p+5x+5Y" #Reposition cursor
<esc>"*v1o1T" #Set mode to print "white" opaquely
<esc>"*c590a490b0P" #Draw smaller white box leaving ruled rectangle
<esc>"*v0o0T" #Restore black print
<esc>"*p-5x-5Y" #Restore cursor to origin

WARNING!!! If there is to be text printed inside the box, then the box MUST be laid down BEFORE the text is printed; otherwise, the text would be erased by the creation of the box. This method then would not be appropriate for an aotomatic overlay as the overlay is run after the page has been imaged.

Jim Asman
http://www.spectracolorservices.com

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

(OP)
Hi Jlasman;

Using the latest code provided I just get the black box.
It does not produce the white area revealing only the border.

Thanks,

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

(OP)
Jim;

The result is a black box.
Here's my test code:
0009: printer on
0010: print hp.esc:char(69):hp.eol ; * Reset
0011: print hp.landscape.mode:hp.eol
0012: print hp.default.page:hp.eol
0013: print hp.esc:"*p500x500Y":hp.eol
0014: print hp.esc:"*c600a500b0P":hp.eol
0015: print hp.esc:"p+5x+5Y":hp.eol
0016: print hp.esc:"v1o1T":hp.eol
0017: print hp.esc:"c590a490b1P":hp.eol
0018: print hp.esc:"v0o0T":hp.eol
0019: print hp.esc:"*p-5x-5Y":hp.eol
0020: printer off
0021: printer close

Thanks,
Steve

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

In your code, there are 4 lines 15-18 are missing the * after the <esc>

Jim Asman
http://www.spectracolorservices.com

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

(OP)
Jim;
I'm still struggling with this.
The goal is to layout 3 rectagles on the 'X' axis and then print data in each of the rectangles.
Each rectangle size is 750x300 with a 300 unit space between each rectangle (2 spaces)
I can print the separate rectangles vertically, but I lose positioning with printing across the 'X' axis.
This is my sample code based on your example sent the other day.
0010: print hp.esc:char(69):hp.eol ; * Reset
0011: print hp.landscape.mode:hp.eol
0012: print "Landscape Mode"
0013: print hp.default.page:hp.eol
0014: *
0015: print hp.esc:"*p0x350Y":hp.eol ; * Initial Position
0016: print hp.esc:"*c750a300b0P":hp.eol ; * Draw Big Black Box
0017: print "Box 1, done"
0018: *
0019: * Box 2
0020: print hp.esc:"*p0x750Y":hp.eol ; * Initial Position
0021: print hp.esc:"*c750a300b0P":hp.eol ; * Draw Big Black Box
0022: *
0023: * Box 3
0024: print hp.esc:"*p0x1150Y":hp.eol ; * Initial Position
0025: print hp.esc:"*c750a300b0P":hp.eol ; * Draw Big Black Box

After laying out the form I need to go back and drop in the text.
Thanks,
GrotonGroup

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

Your problem is probably the "eol", which likely issues a CR which would move mthe cursor back to the left margin.

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

(OP)
Thanks for the info, but my end of line = char(10).

Currently, the boxes print the correct sizes but the run down the left vertical side, not three(3) across
on the horizontal plane. My first one starts at 0,350 then next box should be to the right of the first one and then
the last box to the right of that one.

I'm sure it has to do with eith the absolute or realtive coordinates.
Any assistance is greatly appreciated.

GrotonGroup

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

One handy aspect of the rectangle command is that it doesn't change the
cursor. Any LFs shown here are for clarity and should not be in the PCL
code. A working file, tribox.pcl is attached.Try this ...

<esc>*p0x350Y
<esc>*c750a300b0P<esc>*p+1050X<esc>*c750a300b0P<esc>*p+1050X<esc>*c750a300b0P
<esc>*p5x355Y
<esc>*c740a340b1P<esc>*p+1050X<esc>*c740a340b1P<esc>*p+1050X<esc>*c740a340b1P
<esc>*p0x350Y

What we are doing is this

1. Draw black box, move relative +1050 dots, draw middle black box, move +1050 dots,
draw third black box.

2. Put cursor 5 dots inside left box, then draw white box, move +1050 dots,
draw middle white box, move +1050 dots, draw third white box.

3. Reposition cursor back to origin.

If any of the code lines wrap here, make your window wider.

Let me know how you make out.
~
~

Jim Asman
http://www.spectracolorservices.com

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

(OP)
Jim;
Thank you... Definite progress is being made.
I'll be tweaking it now.
Thanks for your assistance.
GrotonGroup

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

(OP)
Jim;

I'd like to draw three(3) vertical lines below the boxes that you indicated.
They will be printed in landscape mode at coordinates 0,2750 / 0,2125 / 0,275

I appear to be getting a top-of-form and change back to portrait.
Suggestions.

Here's the latest code:
0010: printer on
0011: print hp.esc:char(69) ; * Reset
0012: print hp.landscape.mode
0013: print "Landscape Mode"
0014: print hp.default.page
0015: *
0016: print hp.esc:"*p0x370Y"
0017: print hp.esc:"*c750a300b0P":
0018: print hp.esc:"*p+1075X":
0019: print hp.esc:"*c750a300b0P":
0020: print hp.esc:"*p+950X":
0021: print hp.esc:"*c750a300b0P"
0022: * End Black Rectangles
0023: print hp.esc:"*p5x375Y"
0024: print hp.esc:"*c745a290b1P":
0025: print hp.esc:"*p+1080X":
0026: print hp.esc:"*c740a290b1P":
0027: print hp.esc:"*p+950X":
0028: print hp.esc:"*c740a290b1P":
0029: *-- print hp.esc:"*p0x350Y"
0030: * Do the lines in here
0031: print hp.esc:"*p0x2750Y":
0032: print hp.esc:"*c1100a6b0P"
0033: print hp.esc:char(69)
0034: printer off
0035: printer close

Once again, Thank You
GrotonGroup

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

I need to see the details of your landscape command are.

The code you show, cannot draw the boxes correctly. The +#### dot move to the middle and end box must be the same for both the black boxes and white boxes. That gap does NOT change because the white box is smaller.

0x2750Y is off the bottom of a landscape page. The line that you draw in the code above is horizontal not vertical.

Really, to explain the behavior of your code, I need to see the actual print stream that goes to the printer. So, print to a file and attach that file to your reply, not your translation of your source code.

Jim Asman
http://www.spectracolorservices.com

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

(OP)
Output as requested:
I have the three boxes printing.

0001: ^027E
0002: ^027&l1O
0003: Landscape Mode
0004: ^027&l5.45C
0005: ^027*p0x370Y
0006: ^027*c750a300b0P^027*p+1075X^027*c750a300b0P^027*p+950X^027*c750a300b0P
0007: ^027*p5x375Y
0008: ^027*c745a290b1P^027*p+1080X^027*c740a290b1P^027*p+950X^027*c740a290b1P^
027*p0x2750Y^027*c1100a6b0P
0009: ^027E

Thanks

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

(OP)
Desired Result

-------------------- ------------------ ----------------
| | | | | |
| | | | | |
| | | | | |
-------------------- ------------------ ----------------

| | | |
| | | |
| | | |
| | | |


------------------------------------------------------------

With text printed within the columns and boxes.

Thanks

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

You are missing the point. I want the EXACT data that is going to the printer.

You are showing line numbers and apparent LFs, so I can gleen absolutely nothing from
that code.

Your landscape and init command should show...

Paper size
Orientation
Line Spacing
Top Margin(stated in lines)
Form Length(stated in # number of lines to bottom margin)

It is not clear to me at all as to how these lines are top be laid out. You said you wanted three vertical lines, but your code only shows one horizontal line.

Jim Asman
http://www.spectracolorservices.com

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

I don't understand at all.

Are these vertical lines to be inside the three boxes or does this have nothing to do with the first three boxes?

How tall are these lines to be and how far apart are they to be?

I have always found it considerably quicker to type raw PCL code into a file until I get what I waqnt and only then see about integrating that into your real application. Like the sample files I have posted.


Jim Asman
http://www.spectracolorservices.com

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

(OP)
Jim;

This is the captured output file:
I have not set margins, length or spacing. Just using the defaults.

E
&l1O
Landscape Mode
&l5.45C
*p0x370Y
*c750a300b0P *p+1075X *c750a300b0P *p+950X *c750a300b0P
*p5x375Y
*c745a290b1P *p+1080X *c740a290b1P *p+950X *c740a290b1P *p0x2750Y *c1100a6b0P
E

All lines except 'Landscape Mode' start with <esc>.

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

You rely upon defaults at your own peril.

I can only assume that the formfeed you are getting has something to do with addressing the cursor off the page.

BTW, what OS are you using?

Jim Asman
http://www.spectracolorservices.com

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

I've been vaguely following this thread for the last couple of days, and (like Jim) I'm somewhat confused about what is actually required; the post stating the desired results doesn't show any boxes at all (presumably because this forum has removed multiple spaces (between sets of "|" characters) and replaced them with a single space in each case.

You could also clarify just what you mean by "x-axis" in your comments; in PCL terms, the x-axis is the horizontal axis, and the y-axis is the vertical axis, respectively referring to movement across and down the logical page; on a landscape page the x-axis is parallel to the long edge of the paper, but on a portrait page, the x-axis is parallel to the short edge.

Jim's tribox.pcl sample prints three boxes (wider than they are deep), equidistant along the long-edge of a landscape page; your modification of this prints three similar boxes (but which are not equidistant, and with the right-hand sides missing); it also attempts to print a horizontal black line under the three boxes, but this is not printed, since it is off the page.

I agree with Jim's comments regarding:
  • Use of CarriageReturn and/or LineFeed characters; these are only required when printing text in which each line is not preceded by explicit cursor positioning sequences. CarriageReturn will place the horizontal cursor back to the left margin (whatever that is set or defaulted to) and LineFeed will advance the vertical cursor by one line (the line depth defined by whatever is the current vertical motion index value).
  • The difficulty in following PCL written in pseudo-code in some undisclosed source language (BASIC?).
  • Defaults; do not rely on these, as changes to defaults set on the printer itself can have significant effects on PCL which does not include initialisation sequences.
  • Addressing off the page; your vertical cursor movement to position 2750 (prior to printing the final long horizontal line) in your latest pseudo-capture snippet will place the cursor off the bottom of a landscape page (assuming that the default PCL unit-of-measure is 300 units-per-inch and that the default top-margin is (probably) 0.5 inch).
As mentioned above, there are also other errors in your latest snippet, which results in the white boxes not sitting exactly within the the back boxes.

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

(OP)
Gentlemen;
Thank you. I'm an old time coder and have most of the HP Laserjet font,orientation,style functionality under control. The graphics have been more than challenging.
This project runs on an HP-UX box using a former IBM PostRelational Database (UniVerse).
The programming language is BASIC which is then compiled into psuedo-code.
I am converting an old style pin-feed shipping document to be produced on a Laserjet.
Three boxes on the top, Bill-To Info, Ship-To Info, box 3 Order, Order Dt, Page of...
The multiple 'vertical' lines separate the item#, product, description, ordered, shipped, backorder. This form is to be printed in landscape mode.
All suggestion and advice is greatly appreciated.
GrotonGroup

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

... and here is a sample (based on Jim's tribox.pcl) which (I think) does what you want:

  • Prints a landscape page on Letter size paper.
  • Sets the PCL unit-of measure to 300 units-per-inch (this is the standard default on LaserJet devices).
  • Sets line spacing at 6 lines-per-inch (equivalent to VMI of 8/48 inch), and a top-margin of 3 lines at that spacing.
  • Sets text length at 45 lines (although as the sample doesn't use LineFeed-positioning for text, this is irrelevant).
  • Defaults the left-margin to column zero (the left-edge of the logical page).
  • Draws three boxes (each of width 750 units, depth 300 units, line width 5 units) equidistantly along the long edge of the (landscape) page.
  • Draws four vertical lines (each of depth 900 units) underneath the line of boxes; the left-most and right-most lines align with the left and right sides of the first and third boxes, and use a line-width of 5 units; the other two lines are offset from the left and right sides of the middle box, and use a line-width of 3 units.
  • Draws a horizontal line (of width 2850 units and depth 5 units) underneath the vertical lines.
  • Selects the Courier Bold font, at 12 characters-per-inch, with the ISO-8859-1 character set.
  • Prints some text ("Landscape page") at the top of the page.
  • Prints some text ("Box n") in each box.
  • Selects the Courier Regular font, at 16-characters-per-inch.
  • Prints some text ("text n") in the space underneath each box, between the vertical lines.
Here is the (pseudo-)PCL which does the above (any spaces (except those within text strings) and line feeds are merely to make the set of sequences easier to understand - the actual PCL code doesn't include any):

CODE -->

<Esc>E            Printer Reset
<Esc>&u300D       Unit-of-Measure (300 PCL units per inch)
<Esc>&l2a         Page Size: Letter
       1o         Orientation: Landscape
       6d         Line Spacing (6 lines-per-inch)
       3e         Top Margin (3 lines)
       45F        Text Length (45 lines)
<Esc>*p0x         Cursor Position Horizontal (0 PCL units)
       350Y       Cursor Position Vertical   (350 PCL units)
<Esc>*c750a       Rectangle Size Horizontal (750 PCL units)
       300b       Rectangle Size Vertical   (300 PCL units)
       0P         Fill Rectangular Area: Solid Area
<Esc>*p+1050X     Cursor Position Horizontal (+1050 PCL units)
<Esc>*c750a       Rectangle Size Horizontal (750 PCL units)
       300b       Rectangle Size Vertical   (300 PCL units)
       0P         Fill Rectangular Area: Solid Area
<Esc>*p+1050X     Cursor Position Horizontal (+1050 PCL units)
<Esc>*c750a       Rectangle Size Horizontal (750 PCL units)
       300b       Rectangle Size Vertical   (300 PCL units)
       0P         Fill Rectangular Area: Solid Area
<Esc>*p5x         Cursor Position Horizontal (5 PCL units)
       355Y       Cursor Position Vertical   (355 PCL units)
<Esc>*c740a       Rectangle Size Horizontal (740 PCL units)
       290b       Rectangle Size Vertical   (290 PCL units)
       1P         Fill Rectangular Area: Solid White Areas
<Esc>*p+1050X     Cursor Position Horizontal (+1050 PCL units)
<Esc>*c740a       Rectangle Size Horizontal (740 PCL units)
       290b       Rectangle Size Vertical   (290 PCL units)
       1P         Fill Rectangular Area: Solid White Areas
<Esc>*p+1050X     Cursor Position Horizontal (+1050 PCL units)
<Esc>*c740a       Rectangle Size Horizontal (740 PCL units)
       290b       Rectangle Size Vertical   (290 PCL units)
       1P         Fill Rectangular Area: Solid White Areas
<Esc>*p0x         Cursor Position Horizontal (0 PCL units)
       350Y       Cursor Position Vertical   (350 PCL units)
<Esc>*p0x         Cursor Position Horizontal (0 PCL units)
       700Y       Cursor Position Vertical   (700 PCL units)
<Esc>*c5a         Rectangle Size Horizontal (5 PCL units)
       900b       Rectangle Size Vertical   (900 PCL units)
       0P         Fill Rectangular Area: Solid Area
<Esc>*p+900X      Cursor Position Horizontal (+900 PCL units)
<Esc>*c3a         Rectangle Size Horizontal (3 PCL units)
       900b       Rectangle Size Vertical   (900 PCL units)
       0P         Fill Rectangular Area: Solid Area
<Esc>*p+1050X     Cursor Position Horizontal (+1050 PCL units)
<Esc>*c3a         Rectangle Size Horizontal (3 PCL units)
       900b       Rectangle Size Vertical   (900 PCL units)
       0P         Fill Rectangular Area: Solid Area
<Esc>*p+900X      Cursor Position Horizontal (+900 PCL units)
<Esc>*c5a         Rectangle Size Horizontal (5 PCL units)
       900b       Rectangle Size Vertical   (900 PCL units)
       0P         Fill Rectangular Area: Solid Area
<Esc>*p0x         Cursor Position Horizontal (0 PCL units)
       1750Y      Cursor Position Vertical   (1750 PCL units)
<Esc>*c2850a      Rectangle Size Horizontal (2850 PCL units)
       5b         Rectangle Size Vertical   (5 PCL units)
       0P         Fill Rectangular Area: Solid Area
<Esc>(0N          Primary Font: Symbol Set (0N = ISO 8859-1 Latin 1)
<Esc>(s0p         Primary Font: Spacing: Fixed
       12h        Primary Font: Pitch (12 characters per inch)
       0s         Primary Font: Style (Upright, solid)
       3b         Primary Font: Stroke Weight: Bold
       4099T      Primary Font: Typeface (4099 = Courier)
<Esc>*p0x         Cursor Position Horizontal (0 PCL units)
       200Y       Cursor Position Vertical   (200 PCL units)
Landscape page
<Esc>*p50x        Cursor Position Horizontal (50 PCL units)
       450Y       Cursor Position Vertical   (450 PCL units)
Box 1
<Esc>*p1100X      Cursor Position Horizontal (1100 PCL units)
Box 2
<Esc>*p2150X      Cursor Position Horizontal (2150 PCL units)
Box 3
<Esc>(s0p         Primary Font: Spacing: Fixed
       16h        Primary Font: Pitch (16 characters per inch)
       0s         Primary Font: Style (Upright, solid)
       0b         Primary Font: Stroke Weight: Medium
       4099T      Primary Font: Typeface (4099 = Courier)
<Esc>*p50x        Cursor Position Horizontal (50 PCL units)
       800Y       Cursor Position Vertical   (800 PCL units)
text 1
<Esc>*p1100X      Cursor Position Horizontal (1100 PCL units)
text 2
<Esc>*p2150X      Cursor Position Horizontal (2150 PCL units)
text 3
<Esc>E            Printer Reset 

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

... and what the PCL produces when sent to my local LaserJet 1320n:

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

Well, a LF moves the cursor too.

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

(OP)
Thank you both !!
I will try this code...

Grotongroup

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

>> ... Well, a LF moves the cursor too ...

Indeed it does, but if (as in my sample PCL) all the positioning (for both rectangular area graphics and text) is done using explicit 'set cursor' sequences, this is irrelevant.

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)


As described, this form is essentially like an invoice or customer statement with a header, line items, and maybe some kind of a total section.

This absolutely begs to be set up as a macro, enabled as an automatic overlay. Most certainly, HP-GL/2 to do the line work. So if your basic or whatever can 'cat' a pre-existing file to the printer at the head of the job, your basic code need only to issue the overlay enabling code of a few bytes.

I do quite a bit of this kind of thing and the big "win" is that all the tricky cursor positioning and font changes are in the overlay, so your basic need only spit out the variable data and may very well need NO PCL codes other than the page format and other initializations. I typically just print the data in Courier.

I assume that you may need a "carbon" or two which may or may not need a slightly different overlay, but as the overlay file will probably be <5K there's not much overhead in sending all three in the init. Then, in your variable data enable the appropriate one for that page.

If you are cloning a pinfeed form, there can be an issue where the original form covers the entire sheet and of course you can't print edge to edge on your LaserJet. If that is the case here, you CAN use PCL/HP-GL/2 scaling facilities to create an overlay to use your EXISTING code to print the data onto the laser form.

Food for thought.

Jim Asman
http://www.spectracolorservices.com

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

(OP)
Thanks again, much info to absorb :)
Grotongroup

RE: Sample/Information for PCL or PJL line/box drawing (HP Laserjet)

(OP)
Gentlemen;
The information in this last post was excellent.
I have been able to take the examples and info, make the modifications
and add the logic needed to fullfil the project requirements.
Thank you,
GrotonGroup

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close