GhostPCL character chart?

Brian K. White bw.aljex at gmail.com
Sat Jun 27 12:53:42 PDT 2020


On 6/26/20 3:44 PM, Jay R. Ashworth via Filepro-list wrote:
> This is primarily for BKW, cause I think you're the closest we have to a gpcl
> expert, but I figured I'd put it on the list anyway, case someone else has
> some useful info.
>
> We had to move a client from SuSE ancient.old to something recent at the end
> of last year, and a bunch of their archive invoice reprint code -- which we
> feed to ghostpcl to email it out -- uses chr(255) to put in a "wanted" blank
> line... and the newer gpcl we moved them to:
>
> -----
> Usage: ./pcl6 [option* file]+...
> Options: -dNOPAUSE -E[#] -h -L<PCL|PCLXL> -K<maxK> -l<PCL5C|PCL5E|RTL> -Z...
>           -sDEVICE=<dev> -g<W>x<H> -r<X>[x<Y>] -d{First|Last}Page=<#>
>           -H<l>x<b>x<r>x<t> -dNOCACHE
>           -sOutputFile=<file> (-s<option>=<string> | -d<option>[=<value>])*
>           -J<PJL commands>
> Version: 9.26
> Build date: Tue Nov 20 11:38:51 2018
> Devices: bbox pclm bit bitcmyk bitrgb bitrgbtags bmp16 bmp16m
>   bmp256 bmp32b bmpgray bmpmono bmpsep1 bmpsep8 ccr cfax cif
>   devicen dfaxhigh dfaxlow display eps2write pdfwrite faxg3 faxg32d faxg4
>   fpng gprf inferno ink_cov inkcov jpeg jpegcmyk jpeggray mgr4
>   mgr8 mgrgray2 mgrgray4 mgrgray8 mgrmono miff24 pam pamcmyk32 pamcmyk4
>   pbm pbmraw pcx16 pcx24b pcx256 pcxcmyk pcxgray pcxmono pdfimage24
>   pdfimage32 pdfimage8 pgm pgmraw pgnm pgnmraw pkm pkmraw pksm
>   pksmraw plan plan9bm planc plang plank planm plib plibc
>   plibg plibk plibm pnm pnmraw ppm ppmraw ps2write psdcmyk
>   psdcmykog psdrgb spotcmyk tiff12nc tiff24nc tiff32nc tiff48nc tiff64nc tiffcrle
>   tiffg3 tiffg32d tiffg4 tiffgray tifflzw tiffpack tiffscaled tiffscaled24 tiffscaled32
>   tiffscaled4 tiffscaled8 tiffsep tiffsep1 txtwrite xcf xpswrite ap3250 atx23
>   atx24 atx38 bj10e bj200 bjc600 bjc800 cdeskjet cdj500 cdj550
>   cdjcolor cdjmono cljet5 cljet5c cljet5pr coslw2p coslwxl declj250 deskjet
>   dj505j djet500 djet500c dnj650c eps9high eps9mid epson epsonc escp
>   fs600 hl7x0 ibmpro imagen itk24i itk38 jetp3852 laserjet lbp8
>   lips3 lj250 lj3100sw lj4dith lj4dithp lj5gray lj5mono ljet2p ljet3
>   ljet3d ljet4 ljet4d ljet4pjl ljetplus lp2563 lp8000 lq850 lxm5700m
>   m8510 necp6 oce9050 oki182 okiibm paintjet photoex picty180 pj
>   pjetxl pjxl pjxl300 pxlcolor pxlmono r4081 rinkj sj48 st800
>   stcolor t4693d2 t4693d4 t4693d8 tek4696 uniprint ijs png16 png16m
>   png256 png48 pngalpha pnggray pngmono pngmonod nullpage
> -----
>
> is putting that out as a christian-cross character.  I infer the old gpcl
> did something more useful, but that machine's dead.  I don't seem to be able
> to locate a glyph mapping chart for pcl6 that's in *hex*, or at least decimal,
> and my octal skills are about 45 years old.
>
> Do you know if/where there's a chart that will tell me what to expect pcl6
> to put out for a given decimal CHR(), so I don't have to just try each one?  ;-)
>
> Cheers,
> - jra
>

I would think that would be related to the installed fonts and/or the 
LANG or LC_* settings at run time.

I still have a few opensuse 11.4 boxes and most of our boxes are now 
centos 7

I just tried the following on both an old and new box, and go the same 
output in the pdf, a blank space for chr255

echo -e "chr(255)=\"\0377\"\r" |pcl6 -dNOPAUSE -sDEVICE=pdfwrite 
-sOutputFile=chr255.pdf -


OpenSUSE 11.4:
oh51:~ # pcl6
Usage: pcl6 [option* file]+...
Options: -dNOPAUSE -E[#] -h -L<PCL|PCLXL> -K<maxK> -l<PCL5C|PCL5E|RTL> -Z...
          -sDEVICE=<dev> -g<W>x<H> -r<X>[x<Y>] -d{First|Last}Page=<#>
          -sOutputFile=<file> (-s<option>=<string> | -d<option>[=<value>])*
          -J<PJL commands>
Version: 9.07
Build date: Sun Jun  8 19:40:26 2014
Devices: x11 x11alpha x11mono x11cmyk ljet4 djet500 cljet5pr cljet5c
  bit bitcmyk bitrgb bitrgbtags pcxmono pcxgray pcxcmyk pdfwrite pswrite
  ps2write txtwrite pamcmyk32 pamcmyk4 tiffcrle tiffg3 tiffg32d tiffg4 
tifflzw
  tiffpack tiffgray tiffscaled tiffscaled8 tiffscaled24 tiffscaled4 
tiff12nc tiff24nc pxlmono
  pxlcolor bmpmono bmp16m bmpsep8 pbmraw pgmraw ppmraw png16m pngmono
  pngmonod jpeg plan planm plang planc plank bbox nullpage


Centos 7
dfw24:~ # pcl6
Usage: pcl6 [option* file]+...
Options: -dNOPAUSE -E[#] -h -L<PCL|PCLXL> -K<maxK> -l<PCL5C|PCL5E|RTL> -Z...
          -sDEVICE=<dev> -g<W>x<H> -r<X>[x<Y>] -d{First|Last}Page=<#>
          -H<l>x<b>x<r>x<t> -dNOCACHE
          -sOutputFile=<file> (-s<option>=<string> | -d<option>[=<value>])*
          -J<PJL commands>
Version: 9.27
Build date: Tue Oct  8 11:54:48 2019
Devices: bbox x11 x11alpha x11cmyk x11cmyk2 x11cmyk4 x11cmyk8 x11gray2
  x11gray4 x11mono x11rg16x x11rg32x pclm bit bitcmyk bitrgb bitrgbtags
  bmp16 bmp16m bmp256 bmp32b bmpgray bmpmono bmpsep1 bmpsep8 ccr
  cfax cif devicen dfaxhigh dfaxlow display eps2write pdfwrite faxg3
  faxg32d faxg4 fpng gprf inferno ink_cov inkcov jpeg jpegcmyk
  jpeggray mgr4 mgr8 mgrgray2 mgrgray4 mgrgray8 mgrmono miff24 pam
  pamcmyk32 pamcmyk4 pbm pbmraw pcx16 pcx24b pcx256 pcxcmyk pcxgray
  pcxmono pdfimage24 pdfimage32 pdfimage8 pgm pgmraw pgnm pgnmraw pkm
  pkmraw pksm pksmraw plan plan9bm planc plang plank planm
  plib plibc plibg plibk plibm pnm pnmraw ppm ppmraw
  ps2write psdcmyk psdcmyk16 psdcmykog psdrgb psdrgb16 spotcmyk tiff12nc 
tiff24nc
  tiff32nc tiff48nc tiff64nc tiffcrle tiffg3 tiffg32d tiffg4 tiffgray 
tifflzw
  tiffpack tiffscaled tiffscaled24 tiffscaled32 tiffscaled4 tiffscaled8 
tiffsep tiffsep1 txtwrite
  xcf xpswrite alc1900 alc2000 alc4000 alc4100 alc8500 alc8600 alc9100
  ap3250 atx23 atx24 atx38 bj10e bj10v bj10vh bj200 bjc600
  bjc800 bjc880j bjccmyk bjccolor bjcgray bjcmono cdeskjet cdj1600 cdj500
  cdj550 cdj670 cdj850 cdj880 cdj890 cdj970 cdjcolor cdjmono cdnj500
  chp2200 cljet5 cljet5c cljet5pr coslw2p coslwxl declj250 deskjet dj505j
  djet500 djet500c dl2100 dnj650c epl2050 epl2050p epl2120 epl2500 epl2750
  epl5800 epl5900 epl6100 epl6200 eplcolor eplmono eps9high eps9mid epson
  epsonc escp escpage fmlbp fmpr fs600 gdi hl1240 hl1250
  hl7x0 hpdj1120c hpdj310 hpdj320 hpdj340 hpdj400 hpdj500 hpdj500c hpdj510
  hpdj520 hpdj540 hpdj550c hpdj560c hpdj600 hpdj660c hpdj670c hpdj680c 
hpdj690c
  hpdj850c hpdj855c hpdj870c hpdj890c hpdjplus hpdjportable ibmpro 
imagen itk24i
  itk38 jetp3852 jj100 la50 la70 la75 la75plus laserjet lbp310
  lbp320 lbp8 lex2050 lex3200 lex5700 lex7000 lips2p lips3 lips4
  lips4v lj250 lj3100sw lj4dith lj4dithp lj5gray lj5mono ljet2p ljet3
  ljet3d ljet4 ljet4d ljet4pjl ljetplus ln03 lp1800 lp1900 lp2000
  lp2200 lp2400 lp2500 lp2563 lp3000c lp7500 lp7700 lp7900 lp8000
  lp8000c lp8100 lp8200c lp8300c lp8300f lp8400f lp8500c lp8600 lp8600f
  lp8700 lp8800c lp8900 lp9000b lp9000c lp9100 lp9200b lp9200c lp9300
  lp9400 lp9500c lp9600 lp9600s lp9800c lps4500 lps6500 lq850 lxm3200
  lxm5700m m8510 md1xMono md2k md50Eco md50Mono md5k mj500c mj6000c
  mj700v2c mj8000c ml600 necp6 npdl oce9050 oki182 oki4w okiibm
  oprp opvp paintjet pcl3 photoex picty180 pj pjetxl pjxl
  pjxl300 pr1000 pr1000_4 pr150 pr201 pxlcolor pxlmono r4081 rinkj
  rpdl samsunggdi sj48 st800 stcolor t4693d2 t4693d4 t4693d8 tek4696
  uniprint xes ijs png16 png16m png256 png48 pngalpha pnggray
  pngmono pngmonod nullpage
dfw24:~ #

In both cases, there were no LC_* variables set
In both cases LANG=en_US.UTF-8

dfw24:~ # set |grep "^LC_"
dfw24:~ # set |grep "^LANG"
LANG=en_US.UTF-8
dfw24:~ #

and in both cases the output was a single blank space in place of the 
"\0377" byte.
chr(255)=" "

Setting LANG=C didn't change it.

Note there are no pcl codes in the test echo cmmand. Your real print 
jobs probably have at least some printer init codes and possibly others 
that end up affecting the character set encoding and font selection.

If you want to send me a sample print job, the captured pcl before it's 
fed to pcl6, I'll try it on mine and see if the actual print job with 
whatever pcl you have behaves any different.


Otherwise, here is an overblown script called "asciichart" I made a 
million years ago that will generate all 255 characters with labels, 
minus the non-printable bytes (and the list of non-printable is 
configurable because it's different for practically every terminal or 
other output device).
https://drive.google.com/file/d/1e3Pq5EqsZj8hBnJ08JeVTNnUYqzkFIOr/view?usp=sharing

It's full of dumbness from when I was an infant that I am not going to 
clean up right now, so I'll just show a couple commandlines to get it to 
produce what you want for this usage:

Print all 255 bytes, just to see what all you get.
Since this intentionally doesn't try to exclude anything, the output 
will be messed up by formfeed, tab, backspace, and escape chars. 2 pages 
because of the FF.
TERM=dumb asciichart.ksh -e none -s 0 |unix2dos |pcl6 -dNOPAUSE 
-sDEVICE=pdfwrite -sOutputFile=enone.pdf -
here is the pdf I got from that just so you can compare against your own:
https://drive.google.com/file/d/1aZbAI5PJWMfsK1wtUjwOz8OukRbsb5ra/view?usp=sharing


Then this is the more useful version.
Don't try to print a minimal set of commonly non-printable chars:
TERM=dumb asciichart.ksh -e minimal -s 0 -l |unix2dos |pcl6 -dNOPAUSE 
-sDEVICE=pdfwrite -sOutputFile=eminimal.pdf -
And my output:
https://drive.google.com/file/d/1blaSntfEjMpoz7WhQhaROUu7J75mndtb/view?usp=sharing


You can use "unum" to convert between the various bases and see what a 
given character is, what it's called, etc.
http://www.fourmilab.ch/webtools/unum/

oh51:~ # unum 255
    Octal  Decimal      Hex        HTML    Character   Unicode
     0377      255     0xFF      ÿ    "ÿ"         LATIN SMALL 
LETTER Y WITH DIAERESIS
oh51:~ # unum 0377
    Octal  Decimal      Hex        HTML    Character   Unicode
     0377      255     0xFF      ÿ    "ÿ"         LATIN SMALL 
LETTER Y WITH DIAERESIS
oh51:~ #

So from the asciichart tests maybe you can at least pick some other 
character that works in place of where you were using chr 255.

Since both my old and new systems produce the same nothing for chr 255, 
I can only guess that your old system was somehow using a different font 
because the actual installed font files were different, or something 
about the environment or the pcl codes in the print job caused the 
engine to select a different font, or possibly just interpret the bytes 
differently because of some character set encoding or language setting.

-- 
bkw


More information about the Filepro-list mailing list