On Fri, May 03, 2013 at 09:08:26PM +0100, Steve Simon wrote:
> 
> My need is for postscript to pcl6 for the printer we have, currently I
> run ghostscript under linuxemu which works but I I would prefer to have
> a working native port.
> 

Since I had to try to print to an HP with PCL (in fact, with HPGL
embedded in PCL, with job dispatched by PJL...) I looked for a direct
whatever to HPGL (there was a now nuked program in cups in the
early days) or for whatever to PCL. I have not managed to get a
working ghostscript combination that can be swallowed by the HP
big designjet, so I have read the ghostscript sources and the
cups sources.

Problem: there is a mixing of PJL directly in the drivers (while PJL
should be left outside for what it is: embedding printer jobs---lp
level); cups uses ghostscript mainly to rasterize a PS document and then
to produce PJL and PCL commands to embed this image in a job the PCL
printer can eat.

For the task at end, you might have more success by using the
Ghostscript shipped by Plan9 to create a raw image (à la cups)
and to write the filter to embed this image in PCL commands, and
these in PJL (PCL and PJL are now finally documented by HP).

If you have a network connected printer (or a printer connected to a
bi-directional parallel port) to discover what is supported by the
printer, use PJL (sh(1) example used from an Unix):

------------
#!/bin/sh
#

# lpd status.
#
LPD_OK=0
LPD_ERROR=1
LPD_FATAL=2

PJL_UEL='%-12345X' # Universal Exist Language : sentry

PJL_LANGUAGE_SWITCH='E' # for printers supporting several languages

# If used as a filter for lpd, it has to have "something".
#
cat >/dev/null

# Opening the job.
#
printf '%s' $PJL_UEL

# Ensure we send us something.
#
printf '@PJL USTATUS DEVICE=VERBOSE\n'

# A custom string is echoed because there can be informations sent to
# someone else for something else. This is to now this is linked to our
# request.
#
printf '@PJL ECHO KerGIS requesting config %s\n' "$(date -u '+%F %T')"

# If the printer does not support the category, the answer is:
#
# "?" <CR><LF>
# <FF>
#
# Hence, we ask for everything hoping to have something...

# INFO
#
printf '@PJL INFO ID\n'
printf '@PJL INFO CONFIG\n'
printf '@PJL INFO FILESYS\n'
printf '@PJL INFO MEMORY\n'
printf '@PJL INFO PAGECOUNT\n'
printf '@PJL INFO STATUS\n'
printf '@PJL INFO VARIABLES\n'
printf '@PJL INFO USTATUS\n'

# INQUIRE et DINQUIRE.
#
printf '@PJL INQUIRE PERSONALITY\n'
printf '@PJL INQUIRE RESOLUTION\n'
printf '@PJL INQUIRE RESOURCESAVE\n'

# End of job
#
printf '%s' $PJL_UEL

exit $LPD_OK
-- 
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                      http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C

Reply via email to