Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Jul 2000 16:17:39 +0100
From:      Mark Ovens <marko@freebsd.org>
To:        David Uhring <duhring@charter.net>
Cc:        "Justin W. Pauler" <jwpauler@jwpages.com>, freebsd-stable@freebsd.org
Subject:   Re:
Message-ID:  <20000722161739.B236@parish>
In-Reply-To: <00072208263702.00230@dave.uhring.com>; from duhring@charter.net on Sat, Jul 22, 2000 at 08:14:58AM -0500
References:  <00072123420801.00237@pauler.lgtch02.fais.net> <00072200101801.00223@dave.uhring.com> <20000722120620.A236@parish> <00072208263702.00230@dave.uhring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jul 22, 2000 at 08:14:58AM -0500, David Uhring wrote:
> On Sat, 22 Jul 2000, Mark Ovens wrote:
> > On Sat, Jul 22, 2000 at 12:05:34AM -0500, David Uhring wrote:
> > > On Fri, 21 Jul 2000, Justin W. Pauler wrote:
> > > > Just CVSup'd last night, July 20th, after a complete re-install from my
> > > > 4.0-RELEASE CD's. I then CVSup'd and built/installed the world and proceded to
> > > > make me up a new kernel. Much to my surprise after I compiled everything, my
> > > > system, as it has done many times before, would not compile the kernel with
> > > > -ANY- USB devices what-so-ever. All that is in my kernel relating to USB is
> > > > the following four lines:
> > > > 
> > > >  device          uhci            # UHCI controller
> > > >  device          ohci            # OHCI controller
> > > >  device          usb             # Generic USB code
> > > >  device          ugen            # Generic USB device driver  
> > > > 
> > > >  Now if I attempt to compile this kernel with the code in, I get the following
> > > > error when attempting to link the kernel:
> > > > 
> > > >  linking kernel
> > > >  usb_ethersubr.o: In function `usbintr':
> > > >  usb_ethersubr.o(.text+0x31): undefined reference to `ether_input'
> > > >  *** Error code 1        
> > > >  Stop in /usr/src/sys/compile/PAULER.
> > > > 
> > > >  Therefore I am not able to compile any support for USB in my kernel at
> > > > all. I have found this problem for awhile now and have not been able to
> > > > correct it, even after a complete brand new CVS'up and reinstall. This is
> > > > frustrating as I have several devices I would like to run on my system:
> > > > 
> > > >  Dell XPS Pentium II 233 w/MMX
> > > >  96 MB RAM
> > > >  FreeBSD pauler.lgtch02.fais.net 4.1-RC FreeBSD 4.1-RC #0: 
> > > >  Fri Jul 21 12:52:05 CDT 2000
> > > > 
> > > >  Also, has anyone gotten a HP Deskjet Printer to -successfully- work in
> > > > FreeBSD and X? I just received an HP Deskjet 610c, and after reading the
> > > > handbook and other guides off the internet, installing ifhp, ghostscript and a
> > > > mass of other utilities and filters, I can print from the console (plain text)
> > > > fine. However, when I print from say netscape in X, I just get a bunch of
> > > > postscript junk that my printer either can convert or doesn't understand. I
> > > > know it is not a problem with the printer, as it works fine in Windows =>
> > > > 
> > > > Justin W. Pauler
> > > > 
> > > You need to make /usr/ports/print/apsfilter. And it's a big make to
> > > do the whole thing. Fundamentally, you need the ghostscript
> > > interpreter for postscript. apsfilter converts various types of
> > > output files to postscript and then uses ghostscript to convert the
> > > ps to the PCL your printer needs. Netscape produces postscript (.ps)
> > > files when you print a web page.
> > > 
> > 
> > FWIW I have an HP 610C but I don't use apsfilter, just ghostscript. To
> > make it print from Netscape (or any PS stuff) add this to
> > /etc/printcap (either make it the default ``lp'' entry or set the
> > PRINTER envar to ``hpdj''):
> > 
> >    hpdj|deskjet|Hewlett Packard DeskJet 610C:\
> >         :lp=/dev/lpt0:sh:sd=/var/spool/lpd/:mx#0:\
> >         :if=/usr/local/libexec/hpif:
> > 
> > The input filter, /usr/local/libexec/hpif, is this:
> > 
> > #!/bin/sh
> > #
> > # hpif - Simple text input filter for lpd for HP-PCL based printers
> > # Installed in /usr/local/libexec/hpif
> > #
> > # Simply copies stdin to stdout.  Ignores all filter arguments.
> > # Tells printer to treat LF as CR+LF.  Ejects the page when done.
> > 
> > # printf "\033&k2G" && cat && printf "\033&l0H" && exit 0
> > # exit 2
> > 
> > 
> > #
> > #  Read first two characters of the file
> > #
> > 
> > read first_line
> > first_two_chars=`expr "$first_line" : '\(..\)'`
> > 
> > if [ "$first_two_chars" = "%!" ]; then
> > 
> > 	#
> > 	#  It is PostScript; use Ghostscript to scan-convert and print it.
> > 	#
> > 	#  Note that PostScript files are actually interpreted programs,
> > 	#  and those programs are allowed to write to stdout, which will
> > 	#  mess up the printed output.  So, we redirect stdout to stderr
> > 	#  and then make descriptor 3 go to stdout, and have Ghostscript
> > 	#  write its output there.  Exercise for the clever reader:
> > 	#  capture the stderr output from Ghostscript and mail it back to
> > 	#  the user originating the print job.
> > 	#
> > 	exec 3>&1 1>&2
> > 	/usr/local/bin/gs -dSAFER -sPAPERSIZE=a4 -dNOPAUSE -q \
> > 		-sDEVICE=cdj550 -sOutputFile=/dev/fd/3 - && exit 0
> > 
> > else
> > 
> > 	#
> > 	#  Plain text or HP/PCL, so just print it directly; print a form
> > 	#  at the end to eject the last page.
> > 	#
> > 	printf "\033&k2G" && echo $first_line && cat && \
> > 		printf "\033&l0H" && exit 0
> > fi
> > 
> > exit 2
> > 
> > HTH
> > 
> > > 
> > > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > > with "unsubscribe freebsd-stable" in the body of the message
> > 
> > -- 
> >   If I buy a copy of WinDelete, and it doesn't delete Windows,
> >   am I entitled to my money back?
> > ________________________________________________________________
> >       FreeBSD - The Power To Serve http://www.freebsd.org
> >       My Webpage http://ukug.uk.freebsd.org/~mark/
> > mailto:marko@freebsd.org             http://www.radan.com
> 
> Your filter has the gs output to /dev/fd/3.

Well, I got that file from the Advanced Printing section in the
handbook and just modified the ghostscript commands to suit my
printer. The reason for using fd/3 is explained in the comments in the
file (again from the handbook).

> I have always output to
> /dev/lpt0.

In the script fd/3 is redirected to stdout, and the printf
line is set to read stdin (``cat''). I guess both are
equally valid

> And the ESC char to make HP-812C understand Unix LF is
> 033&k3G.

The original question was about an HP 610C for which 033&k2G is
correct (checking the PCL command list for the 610C it appears that
*both* 2G and 3G are both valid for LF->CR/LF, the difference is that
3G does CR->CR/LF as well, for MAC users I guess).

> If you print nothing but ASCII and Postscript, this is OK.
> I sometimes have the need to print PDF, HTML, etc. For this purpose,
> using apsfilter is really the simplest way to go.

Fair comment. I would use Netscape for printing HTML and Acroread for
PDF, both of which output PS. Obviously if you wish to print a file
directly then something like apsfilter is required.

> http://freebsd.org/ports/print.html now shows apsfilter-5.4.2. One
> of the earlier versions, 5.2.0 IIRC, appeared to be broken, but
> Andreas has a good one in 5.4.2.

-- 
  If I buy a copy of WinDelete, and it doesn't delete Windows,
  am I entitled to my money back?
________________________________________________________________
      FreeBSD - The Power To Serve http://www.freebsd.org
      My Webpage http://ukug.uk.freebsd.org/~mark/
mailto:marko@freebsd.org             http://www.radan.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000722161739.B236>