Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

PCL file creation

229 views
Skip to first unread message

Rick Weiser

unread,
May 1, 2024, 11:21:13 AM5/1/24
to Pick and MultiValue Databases
Hi guys,

Does anyone know PCL on this forum?  We have a set of pick subroutines that build a PCL document to be printed on a PCL printer.  We are missing 2 pieces.

1. a way to include barcodes in the PCL document
2. inserting an image into an existing PCL document.

Please let me know if you have this knowledge.

Thanks,

Rick

Brandon Robinson

unread,
May 1, 2024, 11:22:36 AM5/1/24
to mvd...@googlegroups.com
Hello Rick!

We do! Let me know what I can do to help.




——————————————————
Sent from my mobile gizmo. Typos and misspellings are completely unintended.


--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
---
You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mvdbms/c504bddc-24e7-4fb9-ae4c-3aad88d253f9n%40googlegroups.com.

James A

unread,
May 1, 2024, 11:33:34 AM5/1/24
to Pick and MultiValue Databases
PCL is a relatively simple format; lots of info online; but it's mostly x,y positions and 'dots' or characters (and font definitions etc). But because it's all 'x,y' (or can be: there can be relative positioning too), you don't necessarily need to 'insert', you can 'append' (but before the last few 'reset' characters which are easy to parse).

We do that to add 'fill' text to pre-existing formatted documents: they are separate PCL files that are appended (and of course look 'merged' when printed).

So if you have PCL of your barcodes/images, this might be something you can do with a little code.

But beyond that, it can get complicated; for example if your images are jpeg and/or you need to generate the barcodes.


Joe Goldthwaite

unread,
May 1, 2024, 11:45:34 AM5/1/24
to mvd...@googlegroups.com
If you need to generate the barcode on the fly it can be more difficult. If you have some Python developers they can use the python-barcode library to generate an image file which you can then insert into your PCL document. 

I used to have the HP PCL reference manual somewhere but I can't find it.


Jim Idle

unread,
May 1, 2024, 11:48:09 AM5/1/24
to mvd...@googlegroups.com
Honestly, abandon PCL (and HP printers), and just use a PDF generator. You don't have to write everything in BASIC. 

There are command line tools, libraries, programs you can buy. Ghostscript, imagemagik and probably 50 more.


It is just a font. 

Update to the 20th century Ricky boy!

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
---
You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.

Bruce Decker

unread,
May 1, 2024, 4:25:42 PM5/1/24
to Pick and MultiValue Databases
Been there and done that (hacking PCL) and it's just no fun.  Agree with Mr. Idle.  I wrote a util for most Pick's that allow you to create free .odt templates using OpenOffice/Libre Office doing that WYSWYG pointy-clicky thing.  Then, you just insert [placeholders] for your Picky things, and select barcode font for a placeholder to make a barcode... no programming, even for repeating row-based data.  It's super fast, scales to thousands of printers, makes PDF, and you can make amazingly pretty and complex forms of any type.  Check out:  https://www.bluepinc.com/index.php/bp-forms.

Bob Rasmussen

unread,
May 1, 2024, 7:43:19 PM5/1/24
to Pick and MultiValue Databases
To add to what's been said by others:

1. Barcodes can be added if they are of a type (symbology) supported by
the PCL-5 printer itself, or by an add-in font cartridge (or memory card)
if those are still available. Or you might find a soft font, but you'll
need software to preload the soft font.

2. An image such as in .JPG or .PNG or .TIF format can be run through
various utilities to convert it into a PCL bitmap (raster), which you can
manually code into your report generation program. I believe Black Ice may
have such a conversion utility. Or google "JPG to PCL" or similar.

You're late to the party, as you probably know. But if you're trying to
modify an existing workflow, using PCL, it's pretty challenging.
> --
> You received this message because you are subscribed to
> the "Pick and MultiValue Databases" group.
> To post, email to: mvd...@googlegroups.com
> To unsubscribe, email to: mvdbms+un...@googlegroups.com
> For more options, visit http://groups.google.com/group/mvdbms
> ---
> You received this message because you are subscribed to the Google Groups "Pick and MultiValue
> Databases" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> mvdbms+un...@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/mvdbms/c504bddc-24e7-4fb9-ae4c-3aad88d253f9n%40googlegroups.c
> om.
>
>

Regards,
....Bob Rasmussen, President, Rasmussen Software, Inc.

personal e-mail: r...@anzio.com
company e-mail: r...@anzio.com
voice: (US) 503-624-0360
fax: no longer available
web: http://www.anzio.com
Mailing address: Rasmussen Software, Inc. NEW AS OF JULY 1, 2022
6265 SW Erickson Ave.
Beaverton OR 97008 USA

Diets

unread,
May 11, 2024, 7:14:55 AM5/11/24
to Pick and MultiValue Databases
    SUBROUTINE MAKEBARCODE (WIDTH, HEIGHT, ORIEN, VALUE)
    * $OPTIONS EXT ;* FIXED 18/1/2012
    * PURPOSE   : PRINT BARCODE (CODE 128) ON HP LASERJET PRINTERS
    ** RELEASE   : 4.0
    *************************************************************************
    * This subroutine is used to print bar codes HP laserjet printers using
    * the Printer Control Language.
    *
    * WIDTH (input)  - If a whole number is passed it will be the number of
    *                  dots for a single bar (300 dpi).  If a number less
    *                  one is used it is assumed to be inches for a single
    *                  bar (ex .010 is the same as 3 dots).  If the value
    *                  is null or zero the default of 3 dots (.010") will be
    *                  used.  (max is 15 dots or .5")
    *
    * HEIGHT (input) - If a whole number is passed it will be the number of
    *                  dots for the overall barcode height (300 dpi). If a
    *                  decimal number is used, it is assumed to be inches.
    *                  (ex. for a 1/2 inch barcode use 150 or .5).  The
    *                  maximum is 900 dots or 3.0 inches.
    *
    * ORIEN (input)  - Orientation of the barcode.  Use "0" for horizontal
    *                  (lines going up and down) and "1" for vertical. The
    *                  default is zero.
    *
    * VALUE (input)  - This is the actual data to be encoded.
    *
    * Note: The barcode is printed from the current cursor position.  After
    *       the barcode is printed the cursor is repositioned back to its
    *       original coordinates.
    *************************************************************************
    AM = CHAR(254); VM = CHAR(253)
    EQU TRUE TO 1, FALSE TO 0
    EQU BS TO CHAR(8), ESC TO CHAR(27)
    EQU CODEA TO 1, CODEB TO 2, CODEC TO 3      ;* code fields
    *
GOSUB BUILD.TABLE
    *
    IF WIDTH = "" OR WIDTH = "0" OR NOT(NUM(WIDTH)) THEN WIDTH = 3
    IF INDEX(WIDTH,".",1) THEN WIDTH = (300 * WIDTH) 'R#0'
    IF WIDTH > 15 THEN WIDTH = 15
    *
    IF HEIGHT = "" OR HEIGHT = "0" OR NOT(NUM(HEIGHT)) THEN
       HEIGHT = 150
    END
    IF INDEX(HEIGHT,".",1) THEN HEIGHT = (300 * HEIGHT) 'R#0'
    IF HEIGHT > 900 THEN HEIGHT = 900
    *
    IF ORIEN # 1 THEN ORIEN = FALSE ELSE ORIEN = TRUE
    *
    CHECKSUM = 0
    BAR.CNT = 0
    POSX = 0
    POSY = 0
*************************************************************************
* MAIN
*************************************************************************
*
* print the start code
    BEGIN CASE
       CASE VALUE[1,4] MATCHES "4N"
          CODE.FLD = CODEC
          POS = 106
       CASE VALUE[1,1] < CHAR(32)     ;* control character
          CODE.FLD = CODEA
          POS = 104
       CASE TRUE
          CODE.FLD = CODEB
          POS = 105
    END CASE
    GOSUB PRINT.BAR
*************************************************************************
* print the bar code for each character
    ICNT = LEN(VALUE)
    FOR I = 1 TO ICNT
       BEGIN CASE
          CASE CODE.FLD # CODEC AND VALUE[I,6] MATCHES "6N"
             POS = 100                ;* from A or B to C
             GOSUB PRINT.BAR
             CODE.FLD = CODEC
          CASE CODE.FLD = CODEC AND NOT(VALUE[I,2] MATCHES "2N")
             CHR = VALUE[I,1]
*            LOCATE CHR IN TABLE<CODEB> SETTING FND THEN
             LOCATE(CHR,TABLE,CODEB;FND) THEN
                POS = 101             ;* from C to B
                GOSUB PRINT.BAR
                CODE.FLD = CODEB
             END ELSE
                POS = 102             ;* from C to A
                GOSUB PRINT.BAR
                CODE.FLD = CODEA
             END
       END CASE
       IF CODE.FLD = CODEC THEN
          CHR = VALUE[I,2]
          I += 1
       END ELSE
          CHR = VALUE[I,1]
       END
*      LOCATE CHR IN TABLE<CODE.FLD> SETTING POS ELSE
       LOCATE(CHR,TABLE,CODE.FLD;POS) ELSE
          BEGIN CASE
             CASE CODE.FLD = CODEA
                POS = 101             ;* from A to B
                GOSUB PRINT.BAR
                CODE.FLD = CODEB
             CASE CODE.FLD = CODEB
                POS = 102             ;* from B to A
                GOSUB PRINT.BAR
                CODE.FLD = CODEA
          END CASE
*         LOCATE CHR IN TABLE<CODE.FLD> SETTING POS ELSE
          LOCATE(CHR,TABLE,CODE.FLD;POS) ELSE
             PRINT "BAR-ERROR!":
             RETURN                   ;* error
          END
       END
       GOSUB PRINT.BAR
    NEXT I
*************************************************************************
* print the modulo 103 check character
    POS = MOD(CHECKSUM,103) + 1
    GOSUB PRINT.BAR
*************************************************************************
* print the stop character
    POS = 107
    GOSUB PRINT.BAR
*************************************************************************
* reposition the cursor
    PRINT ESC:"*p-":POSX:"x-":POSY:"Y":
    RETURN
*************************************************************************
PRINT.BAR:
    BAR.PATTERN = TABLE<4,POS>
    JCNT = LEN(BAR.PATTERN)
    FOR J = 1 TO JCNT STEP 2
       BAR = BAR.PATTERN[J,1]
       SPC = BAR.PATTERN[J+1,1]
       IF NOT(ORIEN) THEN
          PRINT ESC:"*c":BAR*WIDTH:"a":HEIGHT:"b0P":
          NEWX = (BAR*WIDTH)+(SPC*WIDTH)-1
          PRINT ESC:"*p+":NEWX:"x+0Y":
          POSX += NEWX
       END ELSE
          PRINT ESC:"*c":HEIGHT:"a":BAR*WIDTH:"b0P":
          NEWY = (BAR*WIDTH)+(SPC*WIDTH)-1
          PRINT ESC:"*p+0x+":NEWY:"Y":
          POSY += NEWY
       END
    NEXT J
    IF BAR.CNT = 0 THEN
       CHECKSUM += (POS-1)
    END ELSE
       CHECKSUM += (POS-1) * BAR.CNT
    END
    BAR.CNT += 1
    RETURN
*************************************************************************
BUILD.TABLE:
    TABLE = ''
    FLD = 0
    FOR I = 32 TO 95
       FLD += 1
       TABLE<1,FLD> = CHAR(I)
    NEXT I
    *
    FOR I = 0 TO 31
       FLD += 1
       TABLE<1,FLD> = CHAR(I)
    NEXT I
    *
    FOR I = 32 TO 127
       TABLE<2,I-31> = CHAR(I)
    NEXT I
    *
    FOR I = 0 TO 99
       TABLE<3,I+1> = I'R%2'
    NEXT I
    *
    TABLE<4>   ='212222':VM:'222122':VM:'222221':VM:'121223':VM:'121322':VM:'131222':VM:'122213':VM:'122312'
    TABLE<4,-1>='132212':VM:'221213':VM:'221312':VM:'231212':VM:'112232':VM:'122132':VM:'122231'
    TABLE<4,-1>='113222':VM:'123122':VM:'123221':VM:'223211':VM:'221132':VM:'221231':VM:'213212'
    TABLE<4,-1>='223112':VM:'312131':VM:'311222':VM:'321122':VM:'321221':VM:'312212':VM:'322112'
    TABLE<4,-1>='322211':VM:'212123':VM:'212321':VM:'232121':VM:'111323':VM:'131123':VM:'131321'
    TABLE<4,-1>='112313':VM:'132113':VM:'132311':VM:'211313':VM:'231113':VM:'231311':VM:'112133'
    TABLE<4,-1>='112331':VM:'132131':VM:'113123':VM:'113321':VM:'133121':VM:'313121':VM:'211331'
    TABLE<4,-1>='231131':VM:'213113':VM:'213311':VM:'213131':VM:'311123':VM:'311321':VM:'331121'
    TABLE<4,-1>='312113':VM:'312311':VM:'332111':VM:'314111':VM:'221411':VM:'431111':VM:'111224'
    TABLE<4,-1>='111422':VM:'121124':VM:'121421':VM:'141122':VM:'141221':VM:'112214':VM:'112412'
    TABLE<4,-1>='122114':VM:'122411':VM:'142112':VM:'142211':VM:'241211':VM:'221114':VM:'413111'
    TABLE<4,-1>='241112':VM:'134111':VM:'111242':VM:'121142':VM:'121241':VM:'114212':VM:'124112'
    TABLE<4,-1>='124211':VM:'411212':VM:'421112':VM:'421211':VM:'212141':VM:'214121':VM:'412121'
    TABLE<4,-1>='111143':VM:'111341':VM:'131141':VM:'114113':VM:'114311':VM:'411113':VM:'411311'
    TABLE<4,-1>='113141':VM:'114131':VM:'311141':VM:'411131':VM:'211412':VM:'211214':VM:'211232'
    TABLE<4,-1>='2331112'
    RETURN
*************************************************************************
    END

Rick Weiser

unread,
May 21, 2024, 3:58:32 PM5/21/24
to Pick and MultiValue Databases
Hi,

Thanks for this.  I will give it a try.

Do you also know how to insert an image (jpg, png, etc) into a PCL document? I know I need to convert it to pcl (I know how to do this) but when I insert the generated PCL into an existing PCL document, all I get is garbage printed.

thanks,

Rick

Dave Pomroy

unread,
May 21, 2024, 6:02:54 PM5/21/24
to mvd...@googlegroups.com
Generate your pcl image code.  
Open the file in an editor like notepad++.
Set the view to display all chars. 
Select the police and do.copy binary.
Then open your basic code in the same editor and paste binary.
Then save your basic code.

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
---
You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.

Rick Weiser

unread,
May 21, 2024, 9:28:10 PM5/21/24
to Pick and MultiValue Databases
I need to programmatically insert the file. 

Dave Pomroy

unread,
May 22, 2024, 8:07:05 AM5/22/24
to mvd...@googlegroups.com
Of its a fixed image, like a logo. Then send the completed pcl to the printer storing it as a macro. Then just call the macro in your print program using pcl/esc code.

If you are trying to print a changing barcode, then simply use the pcl/esc code to call the already installed barcode font on almost all HP printers.

Steven Martin Trimble

unread,
May 22, 2024, 9:17:35 AM5/22/24
to mvd...@googlegroups.com
Rick:
I create a html document for the printout using an html template with anything that is static to the report (or NOT) if necessary.
Then I can convert the html to pdf (if needed as an attachment) in an email.
In my case, I then use AccuTerm to move the document from the cloud server to the user's Windows workstation.
Feel free to give me a call if you'd like more details.

CDMI
Steven Trimble
(501) 772-3450 cell/text


--

Dave Pomroy

unread,
May 22, 2024, 7:06:41 PM5/22/24
to mvd...@googlegroups.com
This is a great way as well. I also use this method. 

Create a html template.
Use a sub routine to populate the template with data as needed. 
Write out result as an html file.
Convert it to pdf with wkhtmltopdf.
Send it as an email attachment via mailsend.exe 

Works great. 

Good suggestion Steve

Steven Martin Trimble

unread,
May 23, 2024, 8:42:36 AM5/23/24
to mvd...@googlegroups.com
thanks Dave
it saves me time, the customer's time, and the result is quite professional looking.
and more importantly, it prints on any printer the customer has.
let the browser do all the work.
take care,

CDMI
Steven Trimble
(501) 772-3450 cell/text

George Gallen

unread,
May 23, 2024, 10:25:23 AM5/23/24
to mvd...@googlegroups.com
We use subroutines for PCL basics and print wizard to handle merging images in then creating pdf to email or print



On May 23, 2024, at 8:42 AM, Steven Martin Trimble <cdm...@gmail.com> wrote:



Rick Weiser

unread,
May 23, 2024, 3:11:23 PM5/23/24
to Pick and MultiValue Databases
We have been using PrintWizard also, but, Ansio is out of business. We can't base our printing needs on them.

Rick Weiser

unread,
May 23, 2024, 3:14:28 PM5/23/24
to Pick and MultiValue Databases
Hi Steve,

How do you deal with paging and non-custom size reports (Shipping Labels) in an HTML report?

Thanks,

Rick

Bob Rasmussen

unread,
May 23, 2024, 3:21:01 PM5/23/24
to Pick and MultiValue Databases
This is Bob Rasmussen, from Rasmussen Software, Inc. We produce Anzio and
Print Wizard.

To clarify: we are not out of business yet, but we are ramping down. We
are advising users that we can not guarantee the availability of technical
support for Print Wizard in the future.
> You received this message because you are subscribed to
> the "Pick and MultiValue Databases" group.
> To post, email to: mvd...@googlegroups.com
> To unsubscribe, email to: mvdbms+un...@googlegroups.com
> For more options, visit http://groups.google.com/group/mvdbms
> ---
> You received this message because you are subscribed to the Google Groups
> "Pick and MultiValue Databases" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mvdbms+un...@googlegroups.com.
> You received this message because you are subscribed to
> the "Pick and MultiValue Databases" group.
> To post, email to: mvd...@googlegroups.com
> To unsubscribe, email to: mvdbms+un...@googlegroups.com
> For more options, visit http://groups.google.com/group/mvdbms
> ---
> You received this message because you are subscribed to the Google Groups "Pick and
> MultiValue Databases" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> mvdbms+un...@googlegroups.com.
>
> To view this discussion on the web visithttps://groups.google.com/d/msgid/mvdbms/CAJDLGm60F7zZU%2B4rAz66%3DBEXVaX3KCCgVCxW7r6F-0uLTRKF1
> A%40mail.gmail.com.
>
> --
> You received this message because you are subscribed to
> the "Pick and MultiValue Databases" group.
> To post, email to: mvd...@googlegroups.com
> To unsubscribe, email to: mvdbms+un...@googlegroups.com
> For more options, visit http://groups.google.com/group/mvdbms
> ---
> You received this message because you are subscribed to the Google Groups "Pick and MultiValue
> Databases" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> mvdbms+un...@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/mvdbms/db360ce2-d34f-48b1-b1e0-57ac40b22bb0n%40googlegroups.c

Steven Martin Trimble

unread,
May 23, 2024, 3:45:09 PM5/23/24
to mvd...@googlegroups.com
yep do it all the time
use 'tables' , 'css' etc
works grand

CDMI
Steven Trimble
(501) 772-3450 cell/text

Reply all
Reply to author
Forward
0 new messages