NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Printing to networked printers? --- SOLVED



With much off-line help from someone who reads this list, I finally
got my printer to work!

I created the attached "magicfilter" script, and added it to my
/etc/printcap file.  Magically, I can now print plain-text files,
as well as .PDF files.

(I'll still need to keep the laptop, since that's the only way I
can use the pritner's scanner function, as well as checking on
ink levels.)



On Wed, 26 Jul 2017, Paul Goyette wrote:

On Thu, 20 Jul 2017, Paul Goyette wrote:

I've tried cups, and given up as it is just too complex and over-
engineered and I don't want to have to understand the insides in
order to get it to work.

<snip>

Am I doomed to keep my windows laptop around forever, just so I
can ftp files there for printing?  Or is there some more "magic"
that I'm missing to get this to work?  Is there a better filter
to use as a starting point?


It is beginning to look like I am doomed to keep the laptop around
(as a "print server") forever.  I got nowhere getting CUPS to work.

I've tried the old-fashioned way of using the print/magicfilter
package, but that invokes ghostscript for the final ps -> PCL3
conversion step, and ghostscript simply won't produce an output
file that works with my printer.  I've attempted to get help from
the ghostscript community, that has produced no viable results.
To paraphrase their responses, "we don't have anyone maintaining
the PCL3 driver, and we don't have anyone who has/knows your
printer;  please try CUPS+hplip which should just work."  Well, it
doesn't "just work."

Debugging this mess is becoming a full-time job, and even though I
am retired and have the time available, this is NOT a job at which
I want to work this hard!.

So, rather than approaching this problem from the direction of
making my "HP DeskJet Ink Advantage 2545" printer work on NetBSD, I
thought I would turn the problem on its side and ask if there is
_anyone_ out there who is printing on NetBSD with the following
requirements, and can provide me with complete and detailed set-up
instructions/examples?

	1. Exact/specific printer make and model, which must be
	   currently available on the open market.
	2. Printer must support WiFi connectivity (hard-wired
	   connection is not an option in my environment)
	3. The configuration/set-up must be capable of printing
	   plain-text and .pdf files.  It is desired that it
	   also be capable of printing image files (jpeg, etc.)
	4. Printer must also work with Windoze, without needed
	   any re-configuration or other set-up changes to
	   switch between Windoze and NetBSD
	5. Printer price must be less than US$250 and must be
	   "new" - not "used" and not "refurbished".  (If I
	   need to buy a new printer, it will have to last me
	   for a while, so it must be current/recent and must
	   come with some sort of support/warranty.)
	6. Hopefully the printer will be available here in the
	   Philippines.  If I have to import it from elsewhere,
	   that would increase the total cost.
	7. Note that I would prefer an ink-jet style printer,
	   but would not reject a laser printer solution.
	8. Similarly, I would prefer something with a _native_
	   postscript interpreter (or emulator), but since that
	   seems to be quite difficult to find, I'm happy with
	   running a rasterizer on the NetBSD system.  But ONLY
	   if it is ABSOLUTELY KNOWN TO WORK!  :)  (I keep
	   getting comments like "the 2540 Series is supported,
	   so it should just work", but it doesn't...)

Anyone got any suggestions?






+------------------+--------------------------+----------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:          |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+------------------+--------------------------+----------------------------+


+------------------+--------------------------+----------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:          |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+------------------+--------------------------+----------------------------+
#! /usr/pkg/bin/magicfilter
#
# Magic filter setup file for HP DeskJet Ink Advantage 2540 series color
# printers
#
# Cloned from dj550c filter, but updated for pcl3gui output
#

# PostScript and .PDF

0 %! filter /usr/bin/env TEMP=${TMPDIR:-/tmp} /usr/pkg/bin/gs -q -dSAFER -dNOPAUSE -r300 -sDEVICE=pcl3 -sSubdevice=unspec -dSendNULs=11000 -dOnlyCRD -sPJLJob="test" -sPJLLanguage=PCL3GUI -sPAPERSIZE=letter -sColorModel=CMYK -dBlackLevels=4 -dCMYLevels=4 -sOutputFile=- -

0 \004%! filter /usr/bin/env TEMP=${TMPDIR:-/tmp} /usr/pkg/bin/gs -q -dSAFER -dNOPAUSE -r300 -sDEVICE=pcl3 -sSubdevice=unspec -dSendNULs=11000 -dOnlyCRD -sPJLJob="test" -sPJLLanguage=PCL3GUI -sPAPERSIZE=letter -sColorModel=CMYK -dBlackLevels=4 -dCMYLevels=4 -sOutputFile=- -

0 %PDF filter /usr/bin/env TEMP=${TMPDIR:-/tmp} /usr/pkg/bin/gs -q -dSAFER -dNOPAUSE -r300 -sDEVICE=pcl3 -sSubdevice=unspec -dSendNULs=11000 -dOnlyCRD -sPJLJob="test" -sPJLLanguage=PCL3GUI -sPAPERSIZE=letter -sColorModel=CMYK -dBlackLevels=4 -dCMYLevels=4 -sOutputFile=- -

#	-sPrintQuality=normal -sMedium=plain \
#	-sCompressionMode=9

### Original attempt - keep for now
### 0 %! filter /usr/bin/env TEMP=${TMPDIR:-/tmp} /usr/pkg/bin/gs -q -dSAFER -dNOPAUSE -r300 -sDEVICE=pcl3 -sSubdevice=unspec  -sPJLLanguage=PCL3GUI -sOutputFile=- -sPAPERSIZE=letter -sColourModel=CMYK -dBlackLevels=4 -dCMYLevels=4 -sPrintQuality=presentation -sMedium=plain -
0 \004%! filter /usr/bin/env TEMP=${TMPDIR:-/tmp} /usr/pkg/bin/gs -q -dSAFER -dNOPAUSE -r300 -sDEVICE=pcl3 -sSubdevice=unspec -dSendNULs -sPJLLanguage=PCL3GUI -sOutputFile=- -sPAPERSIZE=letter -sColourModel=CMYK -dBlackLevels=4 -dCMYLevels=4 -sPrintQuality=presentation -sMedium=plain -
###
###0 \004%! filter /usr/bin/env TEMP=${TMPDIR:-/tmp} /usr/pkg/bin/gs -q -dSAFER -dNOPAUSE -r300 -sDEVICE=cdj550 -sOutputFile=- -sPAPERSIZE=letter -

# TeX DVI
0 \367\002 fpipe /usr/pkg/bin/dvips -D 300 -R -q -f

# compress'd data
0 \037\235 pipe /usr/bin/gzip -cdq

# packed, gzipped, frozen and SCO LZH data
0 \037\036 pipe /usr/bin/gzip -cdq
0 \037\213 pipe /usr/bin/gzip -cdq
0 \037\236 pipe /usr/bin/gzip -cdq
0 \037\240 pipe /usr/bin/gzip -cdq

# troff documents
0 .\?\?\040 fpipe `/usr/bin/grog -Tps $FILE`
0 .\\\" fpipe `/usr/bin/grog -Tps $FILE`
0 '\\\" fpipe `/usr/bin/grog -Tps $FILE`
0 '.\\\" fpipe `/usr/bin/grog -Tps $FILE`
0 \\\" fpipe `/usr/bin/grog -Tps $FILE`

# ditroff
0 "x T ps" pipe /usr/bin/grops
0 "x T dvi" pipe /usr/bin/grodvi
0 "x T ascii" pipe /usr/bin/grotty
0 "x T latin1" pipe /usr/bin/grotty
0 "x T lj4" reject Cannot print LaserJet 4 ditroff files.

# Portable bit-, grey- and pixmaps
0 P1\n pipe /usr/pkg/bin/pnmtops -scale 1000 -dpi 300 2>/dev/null
0 P2\n pipe /usr/pkg/bin/pnmtops -scale 1000 -dpi 300 2>/dev/null
0 P3\n pipe /usr/pkg/bin/pnmtops -scale 1000 -dpi 300 2>/dev/null
0 P4\n pipe /usr/pkg/bin/pnmtops -scale 1000 -dpi 300 2>/dev/null
0 P5\n pipe /usr/pkg/bin/pnmtops -scale 1000 -dpi 300 2>/dev/null
0 P6\n pipe /usr/pkg/bin/pnmtops -scale 1000 -dpi 300 2>/dev/null

# HP Printer Control Language (PCL) -- assume start with reset code
0 \033E\033 cat

# HP Printer Job Language (PJL)
0 \033%-12345X reject Cannot print PJL files on this printer.
0 "@PJL " reject Cannot print PJL files on this printer.
0 @PJL\t reject Cannot print PJL files on this printer.
0 @PJL\r reject Cannot print PJL files on this printer.
0 @PJL\n reject Cannot print PJL files on this printer.

# GIF files
0 GIF87a pipe /usr/pkg/bin/giftopnm 2>/dev/null
0 GIF89a pipe /usr/pkg/bin/giftopnm 2>/dev/null

# JFIF (JPEG) files
0 \377\330\377\340\?\?JFIF\0 pipe /usr/pkg/bin/djpeg -pnm

# TIFF files (the last two bytes of the "magic" is really a version number;
# but the magic is really lame and as far as I have understood the version
# number has never changed and never will, so we include it.)
0 MM\0\x2a pipe /usr/pkg/bin/tifftopnm 2>/dev/null
0 II\x2a\0 pipe /usr/pkg/bin/tifftopnm 2>/dev/null

# BMP files (even lousier magic -- Microsoft strikes again!)
0 BM\?\?\?\?\?\?\?\?\?\?\?\?\x0c pipe \
 /usr/pkg/bin/bmptopnm 2>/dev/null
0 BM\?\?\?\?\?\?\?\?\?\?\?\?\x40 pipe \
 /usr/pkg/bin/bmptopnm 2>/dev/null
0 BM\?\?\?\?\?\?\?\?\?\?\?\?\x28 pipe \
 /usr/pkg/bin/bmptopnm 2>/dev/null

# Sun rasterfiles
0 \x59\xa6\x6a\x95 pipe /usr/pkg/bin/rasttopnm 2>/dev/null

# SGI Imagelib (IRIS RGB) files
0 \x1\xda pipe /usr/pkg/bin/sgitopnm 2>/dev/null
0 \xda\x1 pipe /usr/pkg/bin/sgitopnm 2>/dev/null

# FIG files; reported by Steven P. Hill <sph%uscbu.ih.att.com@localhost>
0 #FIG reject Cannot print FIG files on this printer.

#
# Standard rejects... things we don't want to print
#

# Various archive formats
257 ustar\0 reject Attempted to print a tar file.
257 "ustar \0" reject Attempted to print a tar file.
0 07070 reject Attempted to print a cpio file.
0 PK\3\4 reject Attempted to print a zip file.
20 \xdc\xa7\xc7\xfd reject Attempted to print a zoo file.

# Binaries (Linux): reject with email message
0 \013\1d\0 reject Attempted to print a compiled binary.
0 \100\1d\0 reject Attempted to print a compiled binary.
0 \007\1d\0 reject Attempted to print a compiled binary.
0 \314\0d\0 reject Attempted to print a compiled binary.
0 \177ELF reject Attempted to print an ELF object.
0 \007\001\0 reject Attempted to print an object file.
216 \021\001\0\0 reject Attempted to print a core dump file.
0 !<arch> reject Attempted to print an archive.
0 =<ar> reject Attempted to print an archive.

# Don't confuse this one with troff!
0 .snd reject Attempted to print Sun/NeXT audio data.

# optimistic troff magic
0 . fpipe `/usr/bin/grog -Tps $FILE`
# wacko troff magic
0 ''' fpipe `/usr/bin/grog -Tps $FILE`

# wild guess: PCL control codes start with <ESC>
0 \033 cat

# Default entry -- for normal (text) files. MUST BE LAST.
#default cat \eE\e&k2G\e(0N \eE

#default pipe a2ps -q -1R --columns=80 --rows=66 -o-
default pipe enscript -Bh -q -p-


Home | Main Index | Thread Index | Old Index