# FreeBSD and Printing



## mj12net (Apr 13, 2014)

First, I'm totally new to FreeBSD.

I went through the handbook and successfully printed plain text with `lpr` on my USB HP printer.  I also went through the tutorial to remove stair stepping.

Now I'm wondering what ports or filters I must (and how to) install to print web pages (fully formatted) or if it's more complicated than that.

Thanks.


----------



## wblock@ (Apr 13, 2014)

First, what model of printer is it?  That determines what page description languages it supports.


----------



## mj12net (Apr 13, 2014)

wblock@ said:
			
		

> First, what model of printer is it?  That determines what page description languages it supports.



HP PSC 2410xi Photosmart all-in-one.


----------



## wblock@ (Apr 13, 2014)

In that case, you'll probably have to use HPLIP: print/hplip.  It also requires CUPS.  See http://www.freebsd.org/doc/en_US.ISO8859-1/articles/cups/index.html.


----------



## mj12net (Apr 13, 2014)

From the article: `pkg_add -r cups` - Command not found.  Is it `pkg install cups`?

If I try to do it by ports & portmaster, I get this:

```
===>   hplip-3.14.1 depends on file: /usr/local/bin/python2.7 - found
===>   hplip-3.14.1 depends on executable: pkgconf - found
===>   hplip-3.14.1 depends on executable: pygobject-codegen-2.0 - found
===>   hplip-3.14.1 depends on shared library: libjpeg.so - found
===>   hplip-3.14.1 depends on shared library: libcupsdriver.so - not found
===>    Verifying for libcupsdriver.so in /usr/ports/print/cups-base
===>  Installing for cups-base-1.7.1
===>   cups-base-1.7.1 depends on executable: gtk-update-icon-cache - found
===>   cups-base-1.7.1 depends on shared library: libcups.so - found
===>   cups-base-1.7.1 depends on shared library: libcupsimage.so - found
===>   cups-base-1.7.1 depends on shared library: libpaper.so - found
===>   cups-base-1.7.1 depends on shared library: libatk-1.0.so - found
===>   cups-base-1.7.1 depends on shared library: libgdk_pixbuf-2.0.so - found
===>   cups-base-1.7.1 depends on shared library: libglib-2.0.so - found
===>   cups-base-1.7.1 depends on shared library: libpcre.so - found
===>   cups-base-1.7.1 depends on shared library: libpango-1.0.so - found
===>  Checking if print/cups-base already installed
===>   cups-base-1.7.1 is already installed
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of print/cups-base
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/print/cups-base
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/print/cups-base
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/print/hplip
*** Error code 1

Stop.
make: stopped in /usr/ports/print/hplip

===>>> make failed for print/hplip
===>>> Aborting update

===>>> Killing background jobs
Terminated

===>>> You can restart from the point of failure with this command line:
       portmaster <flags> print/hplip devel/py-qt4-dbussupport devel/py-qt4-core devel/py-sip devel/qscintilla2 print/foomatic-filters print/a2ps print/mpage x11-toolkits/py-qt4-gui graphics/qt4-iconengines x11/qt4-inputmethods 

===>>> Exiting
```


----------



## wblock@ (Apr 13, 2014)

What version of FreeBSD are you using?  Have you switched to pkg(8)?


----------



## mj12net (Apr 13, 2014)

wblock@ said:
			
		

> What version of FreeBSD are you using?  Have you switched to pkg(8)?



FreeBSD 10.  Second question, I have no idea.  I was using ports and portmaster to install hplip but it failed.  I made a mistake earlier, print/cups installed fine, not print/hplip.


----------



## wblock@ (Apr 14, 2014)

FreeBSD should not even have `pkg_add` installed.  Please do not use those old commands, they will make a mess of the package database.

Using ports and portmaster(8) will work.

I don't know what caused the error with CUPS, but I would first try deleting the CUPS ports `pkg delete -ix cups-` and reinstall print/hplip.


----------



## mj12net (Apr 14, 2014)

wblock@ said:
			
		

> FreeBSD should not even have `pkg_add` installed.  Please do not use those old commands, they will make a mess of the package database.
> 
> Using ports and portmaster(8) will work.
> 
> I don't know what caused the error with CUPS, but I would first try deleting the CUPS ports `pkg delete -ix cups-` and reinstall print/hplip.



CUPS installed fine.  The print/hplip port would not work at all.  I reinstalled FreeBSD 10 and still wouldn't work from ports. I guess I'm out of luck.


----------



## wblock@ (Apr 14, 2014)

Whoops, that's an inkjet, which should use print/hpijs.  There were recent changes to CUPS that may not have settled out yet, but try that.


----------



## mj12net (Apr 14, 2014)

wblock@ said:
			
		

> Whoops, that's an inkjet, which should use print/hpijs.  There were recent changes to CUPS that may not have settled out yet, but try that.



I installed print/hpijs and configured using the localhost:631 method under CUPS.  Installed the right PPD but no luck printing anything.  Is there permissions I have to set for printing to work?  The closest I get to printing is doing a self test page - it starts to print then stops immediately.


----------



## wblock@ (Apr 15, 2014)

Did you use the /dev/unlpt0 device?


----------



## mj12net (Apr 15, 2014)

wblock@ said:
			
		

> Did you use the /dev/unlpt0 device?



Yes, in CUPS I selected the non reset USB printer.


----------



## mj12net (Apr 16, 2014)

Went ahead and reformatted and reinstalled FreeBSD 10.  Seems to have cleared up something as printing works now.  Installed print/cups and print/hpijs and set up CUPS printer on non reset usb and it started working.

Thanks for your help.


----------

