Penguin
Note: You are viewing an old revision of this page. View the current version.

Printing to PDF

If you have an application that can't output natively to PDF, you can create yourself a PDF printer.

  1. Get the backend for it - look for PDF Distiller Script from http://printing.kde.org/downloads/
  2. Install this as 'pdf' in /usr/lib/cups/backends, and set it world executable.
  3. You may need to restart CUPS (e.g. on RedHat systems run 'service cups restart')
  4. You probably need GhostScript installed (try looking for a package called gs-common) for ps2pdf(1).
  5. Add a printer, either using the web interface (http://localhost:631/), XimianDesktop's printer interface, or the command line:

lpadmin -p PDFcreator -v pdf:/home/chris/PDFfiles -E -P /path/to/distiller.ppd

You can use any "raw" ppd you want really - I used the Raw/Raw (en) option in the installer, and it worked fine. You can download a color postscript ppd file from the cups-pdf site.

Create the printer with the URI of pdf:/where/you/want/the/output.

Easy as that. Then you can set Samba up to print to this printer via CUPS.

There are some notes on how this can be used with Samba to email PDFs to you on the SambaPDFPrinter page (Which also has a PDF Printer setup for LPRng).

There is also a cups-pdf virtual backend which can be used to print to pdf from cups. Your distribution should distribute this - for example, Debian (Sarge or Sid) users can "apt-get install cups-pdf".


Cups and SAMBA

See the SambaPrinting page for more information


Auto-discovery of printers

CUPS can do broadcasts over a network to both advertise the availability of local printers as well as to find and "proxy" for remote printers. On a LAN this is probably what you want, but if you are on the MetaNet this may result in other people seeing your printers, and you seeing theirs. This can have unpleasant side-effects: for example, my cups found remote printers that were later firewalled/disconnected or removed. Later that day when starting a GNOME application, it would hang on start-up as the gnome printing backend tried contacting the remote printers which were now un-contactable.

Anyway, the lesson is to edit cupsd.conf to disable this. (This is in the /etc/cups/ directory in Debian and RedHat.) Either disable browsing completely by adding the line
Browsing off

Or set the network/address mask for the !BrowseAllow?/!BrowseDeny? variables (for incoming broadcasts) and !BrowseAddress? (for outgoing broadcasts). Debian Woody defaults to browsing on, accepting incoming information from anywhere and not sending out any information.


Setting up a Brother Laser printer

These are just some observations of what I did to set up a Brother HL 1440 laser printer (using the USB port) on a machine that already had CUPS installed, and had an HP Deskjet installed. This was done on debian woody (or close enough to woody) remotely via an ssh connection. These instructions also worked perfectly for a Brother HL 1430 on a Redhat 9 system running XimianDesktop although I didn't use any of the graphic configuration tools.

Preparation

Make sure the kernel has USB Printer support. I created a kernel module (CONFIG_USB_PRINTER) and made sure it installed ok.

Make a device file. I assume people using devfs don't need to do this manually. I did
mkdir /dev/usb mknod /dev/usb/lp0 c 180 0

although some people use the name "/dev/usb/usblp" instead.

Config files

Foomatic is the cups package with all the printer description files (*.PPD) and setup stuff.

To determine which driver cups needs to use, you do

  1. foomatic-configure -O | less

which lists all the supported printers, and search for your printer. If I search for "1440" I find an entry for the new printer that includes the line

<driver>hl1250</driver>

Now the magic line

foomatic-configure -s cups -n Brother -c file:/dev/usb/lp0 \

  • p Brother-HL-1440 -d hl1250 -o !PageSize?=A4

(This should all be on one line, without the "\") This says to use the cups printing system, and name the new printer "Brother". The -p and -d options are the printer ID and driver I got from the previous step in the output. Also I used an option to set the default page size to A4.

Note that this can't be done until the printer is connected, as I got a "client-error-not-possible" error until someone at the remote end plugged the new printer into the USB port.

You can also access cups by going to http://localhost:631 and authenticating as any user in the "lpadmin" group (I used root). From here I printed a test page and made this the default printer.

You can also make it the default printer by editing /etc/cups/printers.conf or with the command "lpadmin -d Brother"

/etc/printcap

4) Edit /etc/printcap for "Legacy" applications. cups does make a printcap file, but in debian the default name is /etc/printcap.cups. Just copy that - it had empty entries for my two installed printers.

Gotchas

remove /.lpoptions (for all users) as that hard-coded the default printer to be the old one! I don't know what created that file, as only some users had it.

Check for a PRINTER environment variable and make sure that it's either unset or set correctly.


I'm using linux debian woody, with kernel 2.4.18 mknod /dev/usb/lp0 c 180 0 allowed cups to see the printer but not to work. The only solution seems to upgrade the kernel or to use a different printer.c that comes from hpoj.sourceforge.net, but I still have not tested it...

Possibly to do with the USB support in the kernel? -- JohnMcPherson


See CupsAccounting

Part of CategoryPrinting http://zhanshijia.shop263.com http://shengwufanyingqi.shop263.com http://bijibendiannao.0008888.com http://chengrenyongpin.0008888.com http://fanyi.0008888.com http://xianhua.0008888.com http://yimin.0008888.com http://fanyigongsi.0008888.com http://zufang.0008888.com http://youxi.0008888.com http://youxixiazai.0008888.com http://moping.0008888.com http://bizhi.0008888.com http://fuwuqi.0008888.com http://aizibing.0008888.com http://bangongzidonghua.0008888.com http://chuguo.0008888.com http://duanxin.0008888.com http://ganzaoshebei.0008888.com http://jiaoyou.0008888.com http://liaotian.0008888.com http://menjin.0008888.com http://neiyi.0008888.com http://shengjiangji.0008888.com http://1shipin.0008888.com http://xiezhen.0008888.com http://yiqiyibiao.0008888.com http://yidongcunchu.0008888.com http://yinyue.0008888.com http://zikao.0008888.com http://suanming.0008888.com http://huipu.0008888.com http://nuojiya.0008888.com http://tiyucaipiao.0008888.com http://wangyezhizuo.0008888.com http://qianliexian.0008888.com http://suoni.0008888.com http://chongwu.0008888.com http://dalian.0008888.com http://dianli.0008888.com http://fulicaipiao.0008888.com http://gerenzhuye.0008888.com http://guanggaogongsi.0008888.com http://guojimaoyi.0008888.com http://kuaiji.0008888.com http://jisuanjidengjikaoshi.0008888.com http://jiaotong.0008888.com http://kuandai.0008888.com http://mianfeikongjian.0008888.com http://nongye.0008888.com http://qiyewenhua.0008888.com http://rencai.0008888.com http://rencaiwang.0008888.com http://sheji.0008888.com http://shoujibaojia.0008888.com http://tushu.0008888.com http://wangluo.0008888.com http://wangluoyouxi.0008888.com http://wuyeguanli.0008888.com http://ximenzi.0008888.com http://xiaolingtong.0008888.com http://youerjiaoyu.0008888.com http://youeryuan.0008888.com http://yule.0008888.com http://zhucekuaijishi.0008888.com http://caiwu.0008888.com http://caiwuguanli.0008888.com http://chuguoliuxue.0008888.com http://diannaopeixun.0008888.com http://duomeiti.0008888.com http://fanyiruanjian.0008888.com http://feijipiao.0008888.com http://gouwu.0008888.com http://guanli.0008888.com http://hunshasheying.0008888.com http://jiguang.0008888.com http://jisuanjipeixun.0008888.com http://kongjian.0008888.com http://lvshi.0008888.com http://lvshishiwusuo.0008888.com http://maoyi.0008888.com http://meirongmeifa.0008888.com http://moxing.0008888.com http://nami.0008888.com http://shangbiao.0008888.com http://shujuku.0008888.com http://tongxun.0008888.com http://wangluoanquan.0008888.com http://xiangmuguanli.0008888.com http://xie.0008888.com http://yasi.0008888.com http://yingyupeixun.0008888.com http://yuanlin.0008888.com http://zhaobiao.0008888.com http://zhi.0008888.com http://zhongyi.0008888.com