Contact US

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.

Students Click Here

PCL print program

PCL print program

PCL print program

I would like to develop a PCL print program.

I am experienced in PCL but not real great with API printing. I'd like to do it in PowerBasic for windows.

If anyone is interested, I think it could be lucrative.

RE: PCL print program

Just what do you mean by a PCL print program:
  • A PCL viewer (like SwiftView)?
  • A PCL analyser (there are several available; I've written one (in C++) for internal use in my company)?
  • A PCL generator (to do things like box drawing, etc.)?
  • Or what?

RE: PCL print program

Primaraly to print pcl on any printer. A preview would be
nice but not mandatory.

I have created dialogs then printed the window which works
fine but I usually need to print more for the entire page
and have not been able to print an entire window if the window is larger (height) than the screen.

I can also send pcl to a printer and let the printer interpret the pcl. This works fine for LaserJets and most
inkjets that support PCL but won't print to, for example,
dot matrix printers.

I also have a DLL (DLLPRINT) that will print to any printer
using ESC/P2 syntax (with a few differences - some esc sequences not supported and a few additional that are just for dllprint). It's good but I have to use reverse line feeds to move up the page rather than a simple Esc&a#r#H sequence (or Esc&a#v#H)

I also have LaserTwin that I use for a reference but it's a
MS-DOS program. Never saw (though I've seen reference to) the windows version (it may have only worked on W3.1).

RE: PCL print program

what do you do with your PCL analyser, DansDadUK ????

RE: PCL print program

@DansDadUK I second that question.  What is the licence?  Is it available to others who use PCL?  Its name certainly sounds interesting.  Is it like PCLCodes in PCLTools?


RE: PCL print program

My PCL Analyser tool (Windows-only (created using Borland C++ Builder)) parses and provides an interpretation of the PCL, PJL, HP-GL2 and PCLXL sequences in a specified file, so it is a bit like PCLCodes.

At present, it is an internal-use only tool, although I suppose that if there was sufficient interest, my company might provide a licensed external version.

Sample output (in text form, I can't show screen shots here) for PCL5:


Offset(dec)  Type                   Sequence          Data / Interpretation
¯¯¯¯¯¯¯¯¯¯  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
0000000000  Special                <Esc>%-12345X     Universal Exit Language (UEL)
            Comment                                  Switch language to PJL
0000000009  PJL Command                              @PJL SET PAGEPROTECT=OFF[0a]
0000000034  PJL Command                              @PJL SET USERNAME="1"[0a]
0000000056  PJL Command                              @PJL SET HOLD=OFF[0a]
0000000074  PJL Command                              @PJL SET QTY=1[0a]
0000000089  PJL Command                              @PJL SET RESOLUTION=600[0a]
0000000113  PJL Command                              @PJL ENTER LANGUAGE=PCL[0a]
            Comment                                  Switch language to PCL
0000000137  Data                                     [0d]
0000000138  PCL Simple             <Esc>E            Printer Reset
0000000140  PCL Complex            <Esc>*t600R       Raster Graphics Resolution (dpi)
0000000147  PCL Complex            <Esc>&u600D       Unit-of-Measure (PCL units per inch)
0000000154  PCL Complex            <Esc>*r0F         Raster Graphics Presentation: Logical
0000000159  PCL Complex            <Esc>&l0o         Orientation: Portrait
0000000164                                1E         Top Margin (lines)
0000000166  PCL Complex            <Esc>&l0S         Simplex/Duplex: Simplex
0000000171  PCL Complex            <Esc>&l2H         Paper Source: Value is Printer Dependent
0000000176  PCL Complex            <Esc>&l2a         Page Size: Letter
0000000181                                8c         Vertical Motion Index (1/48 inches)
0000000183                                1E         Top Margin (lines)
0000000185  PCL Complex            <Esc>*p0x         Cursor Position (PCL units): Horizontal
0000000190                                0Y         Cursor Position (PCL units): Vertical
0000000192  PCL Complex            <Esc>*c0t         Set Picture Frame Anchor Point
0000000197                                5760x      Picture Frame Size (decipoints): Width
0000000202                                7704Y      Picture Frame Size (decipoints): Height
0000000207  PCL Complex            <Esc>&l1X         Number of Copies
0000000212  PCL Complex            <Esc>*b0M         Set Compression Mode: Unencoded
0000000217  Data                                     [0d]
0000000218  PCL Complex            <Esc>*c16534D     Assign Font ID Number
0000000227  PCL Complex            <Esc>)s8984W      Download Font Header
0000000235  PCL Binary             [ 72 bytes ]      Font header descriptor:
            Descriptor Size:                         72
            Header Format:                           15: Truetype Scalable
            Font Type:                               2: Bound; PC-8 (0x01-06, 0x10-1a, 0x1c-ff printable)
            First Code:                              [0020]
            Last Code:                               [00ff]
            Symbol Set:            Kind1 value:      17
                 ---->             Identifier:       0Q
            Spacing:                                 1: Proportional
            Scaling:               Technology:       1: TrueType
                                   Variety:          0
            Scale Factor:                            8 design units per Em
            Master Design:         Space Width:      640 design units
            Style:                 Value:            992
                                   Structure:        >=576: Unknown (Reserved)
                                   Width:            0: Normal
                                   Posture:          0: Upright
            Stroke Weight:                           0: Medium (Book or Text)
            Typeface:              Family Code:      254
            Font Name:                               Tahoma
            Orientation:                             0: Portrait
            Serif Style:                             0: Sans Serif Square
            Width Type:                              0: Normal
            Quality:                                 2: Letter Quality
            Placement:                               0: Normal
            Cell Width:                              3969 design units
            Text Width:                              910 design units
            Cell Height:                             2543 design units
            Text Height:                             2107 design units
            Cap Height:                              1489 design units
            Underline:             Thickness:        102 design units
                                   Position:         409 design units below baseline
0000000307  PCL Binary             [ 8910 bytes ]    Font header segmented data:
0000000307  Segment type:                            PA: Panose Description
0000000309  Segment length:                          10
0000000311  Segment data           [ 10 bytes ]      
0000000321  Segment type:                            GT: Global TrueType Data
0000000323  Segment length:                          8888
0000000325  Segment data           [ 1723 bytes ]    
0000002048  Segment data           [ 2048 bytes ]    
0000004096  Segment data           [ 2048 bytes ]    
0000006144  Segment data           [ 2048 bytes ]    
0000008192  Segment data           [ 1021 bytes ]    
0000009213  Segment type:                            0xffff: Null segment
0000009215  Segment length:                          0
0000009217  Reserved byte          [00]              
0000009218  Checksum               [c1]              
0000009219  PCL Complex            <Esc>(s9.5V       Primary Height (points)
0000009226  PCL Complex            <Esc>(16534X      Select Primary Font by ID
0000009234  PCL Complex            <Esc>&d@          Underline Disable
0000009238  PCL Complex            <Esc>*c32E        Character Code
0000009244  PCL Complex            <Esc>(s170W       Download Character
0000009251  PCL Binary             [ 170 bytes ]     
0000009421  PCL Complex            <Esc>*c33E        Character Code
0000009427  PCL Complex            <Esc>(s112W       Download Character
0000009434  PCL Binary             [ 112 bytes ]     
0000009546  PCL Complex            <Esc>*c34E        Character Code

and for PCLXL:


Offset(dec)  Type                   Sequence          Data / Interpretation
¯¯¯¯¯¯¯¯¯¯  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
0000000000  Special                <Esc>%-12345X     Universal Exit Language (UEL)
            Comment                                  Switch language to PJL
0000000009  PJL Command                              @PJL ENTER LANGUAGE = PCLXL[0d][0a]
            Comment                                  Switch language to PCLXL (PCL6)
0000000038  PCLXL Stream Header    0x292048..        ") HP-PCL XL;2;0;Gandlake LaserServe PCL XL drive"
0000000086                         0x720a            "r[0a]"
0000000088  PCLXL Data Type        0xc0                  ubyte
0000000089             Value       0x00                  eInch
0000000090  PCLXL Attribute        0xf886              Measure
0000000092  PCLXL Data Type        0xd1                  uint16_xy
0000000093             Value       0xe803e803            1000 1000
0000000097  PCLXL Attribute        0xf889              UnitsPerMeasure
0000000099  PCLXL Data Type        0xc0                  ubyte
0000000100             Value       0x02                  eErrorPage
0000000101  PCLXL Attribute        0xf88f              ErrorReport
0000000103  PCLXL Operator         0x41              BeginSession
                           No.                       1
0000000104  PCLXL Data Type        0xc0                  ubyte
0000000105             Value       0x00                  eDefaultDataSource
0000000106  PCLXL Attribute        0xf888              SourceType
0000000108  PCLXL Data Type        0xc0                  ubyte
0000000109             Value       0x01                  eBinaryLowByteFirst
0000000110  PCLXL Attribute        0xf882              DataOrg
0000000112  PCLXL Operator         0x48              OpenDataSource
                           No.                       2
0000000113  PCLXL Data Type        0xc8c10900            ubyte_array
0000000117             Value       0x474c4c..            "GLLSForm1"
0000000126  PCLXL Attribute        0xf88b              StreamName
0000000128  PCLXL Operator         0x5b              BeginStream
                           No.                       3
0000000129  PCLXL Data Type        0xc2                  uint32
0000000130             Value       0xab000000            171
0000000134  PCLXL Attribute        0xf88c              StreamDataLength
0000000136  PCLXL Operator         0x5c              ReadStream
                           No.                       4
0000000137  PCLXL Data Type        0xfb                  embedded_data_byte
0000000138  PCLXL Embedded Len.    0xab                  171
0000000139                 Data    [ 171 bytes ]     
0000000310  PCLXL Operator         0x5d              EndStream
                           No.                       5

RE: PCL print program

Well if you choose a FOSS licence I would love to try it.  I'm a service technician for Canon Canada Inc.  One of my main functions is troubleshooting PCL from mainframes and UNIX boxes.  This tool looks very handy for that.  kudos to you for writing it.  I'm curious, how does it handle a bad escape sequence?  Like <Esc>&f15X or <Esc>(s7P or <Esc>s1P.  

Sorry I got a little excited there.


RE: PCL print program

I use Pitneys Print Stream Analyst it does the same thing but both are missing 1 thing....a hex editor window to manipulate the pcl. I may just write one myself that does this....

RE: PCL print program

Uncle Rick; your invalid sequences would be reported as:


Offset(dec)  Type                   Sequence          Data / Interpretation
¯¯¯¯¯¯¯¯¯¯  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
0000000000  PCL Complex            <Esc>&f15X        Macro Control (?value)
0000000006  PCL Complex            <Esc>(s7P         Primary Spacing (?value)
            *** Warning ***                          Unexpected sequence found:
0000000011  Data                                     [1b]s1P
and the application indicates (via a popup) that an invalid sequence was detected (for the last one only, as the first two are valid sequences with unknown values).

By the way, what does FOSS stand for? I assume it's something to do with Open Source?

RE: PCL print program


I thought of adding hex-editing to my analyser, but decided that there are better tools for this already available.

I use my analyser to interpret the contents, then use HexWorkshop (www.bpsoft.com) to make any required changes (finding the correct position is easy as the analyser shows the file offsets); I then repeat the analysis to confirm the changes are correct (especially when editing PCLXL).

RE: PCL print program

What I would like to work on, is a dll that I can
use to print pcl reports to any printer whether
it be dot matrix or BJ or HP LJ/IJ compatible.

I can print PCL to an HP compatible Laser / Ink jet
now, but there are still users of epson compatible
ESC/P and others that I would like the program to
work with too.

Of course the printer would have to have graphics
capability, that's a given, and a driver that would

One idea, would be to convert the report to a BMP,
then print the BMP using api calls.

Another idea is to convert the report to a windows
window, and print the window to the printer.

I can print the window to the printer and have had
success to an extent making the report look right
but the problem is getting the entire page so it
shows on the screen because I can only, at present,
print what's visible in the window, even though I
may have a larger window (scrollable).

RE: PCL print program


I think that what you are trying to achieve is already provided by SwiftView (via the DirectPrint, FastPrint and WindowsPrint options).

RE: PCL print program

I am aware of other third-party software. I am not happy
with any I have seen. Some are ok but not what i'd like.
Besides, I would like to develop one for sale as well as
use in my own circumstance. I haven't seen any that will
print pcl to a dot matrix printer (i.e. do a conversion).

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! Already a Member? Login

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