The Linux Printing HOWTO

  : Grant Taylor, <gtaylor+pht@picante.com>
  : 3.10
 : 1996 9 10
   : ⼺, <nowlinux@soback.kornet.nm.kr>

0.   

  Grant Taylor Linux Printing HOWTO ѱ
̴. Linux Printing HOWTO Linux ȯ濡 (Ÿ н
ȯ濡  κ  ) Ʈ (print),
̸(preview), ѽ(fax) 뿡  ڷḦ  ̴. 

, ڴ     ߻  ִ /
սǿ ؼ  å̳  ǹ   ʴٴ 
̸ д. ׸,       ߸
 ɼ ִٴ  ϶. (   ϱ
ؼ ǿ κ .) 

0.1  ܵ 

  ϴ  " Ʈ   ȯ漳"
 κ  ʾҴ. ʿ   ϶. ڼ
 8 ϶. 

1. Ұ(Intro)

  ٽ ۼ߱   뿡  ڷᰡ
. ̴  HOWTO   60 typeset ʿ ̸ 
Ŀ  ̾߱   ־ ̴. 
 ϴ ذå ã  ٸ  
a) PHT Ȩ <http://www.picante.com/~gtaylor/pht/>
  PHT ų 
b) (PHT  grant taylor)     ָ
ȴ. 

Printing HOWTO Ȩ <http://www.picante.com/~gtaylor/pht/>
 ֽŹ PHT   ִ;  Sunsite(sunsite.unc.edu)
 LDP ̷ Ʈ   ִ. 

1.1. õ(History)

   ° ̴. ,    ۼǴ  
° ƴٴ ǹ̴. PHT õ ð  ؼ 
. 

1.  Ʈ õǾ comp.so.linux ö  
ؼ printing-howto ʷ ۼϰ ̸ ߴ.   
HOWTO Ʈ ۵Ǿ,    `HOWTO' Ҹ
ʴ FAQ̾.    Ϲ ascii. 

2. HOWTO Ʈ  , Printing-HOWTO Brian McCauley

<B.A.McCauley@bham.ac.uk> Lpd FAQ . 츮  2⵿
PHT  ۼߴ.  κп Karl Auer
<Karl.Auer@anu.edu.au> ڷḦ Խ״. 

  PHT TeXinfo ̾, PS, HTML, Ascii, Info 
˵ ־. 

3. 1  PHT   , ٸ maintainer Ϸ õ
    İ  ü  ߴ. 
PHT Linuxdoc-SGML̴. 

1.2. ۱(Copyright)

  ۱ Grant Taylor  ִ.(Copyright (c) 1996 by Grant
Taylor) 

 Ǵ   ̸ ų,   ʵ ϶.

2. ϴ (How to print)

 Ϳ 缭 lpd  ưų ý ڰ ׷
  ξų, Ǹžڱ ̸ ȯ漳   , lpr
ɾ  ͸  ȴ.   

The Printing-Usage HOWTO
<http://sunsite.unc.edu/mdw/HOWTO/Printing-Usage-HOWTO.html> 
 ׷  ٷ  Ʈ ť(queue) ٷ   ʼ
ɾ ؼ ϰ ִ. 

3. Kernel printer devices

3.1. lp device

lp ̽ Ŀο ϵ ϰų  о鿴ٰ
  (cat /proc/devices  ϸ lp ̽  
µȴ)  Ŀο  /dev/lp0, /dev/lp1, /dev/lp2 ϳ
̻ ̽ Ѵ.  ġ  (dynamically)
ҴǴ  ƴϸ  ̽ Ư H/W  ּҿ
Ѵ. ,   ϵ  ù ° ʹ lp0 ̳
lp1   ִٴ ̴.  

  ׽Ʈ .. :) plip lp ̹  Ʈ ÿ
  .  ׷,  Ǵ Ŀ 2.0.x ϴ (Ǵ
1.3.x Ĺݺ) kerneld ̿ؼ  ð  ̹
  ִ. ͷƮ(interrupt)  ϰ   
 ̿ϸ, Ƹ  Ʈ plip, ٸʿ lp 
    ȴ. 

 ̴ ̹ ҽ Ͽ ̷ ߴ. ;  ܼ ɾ
Է¸ ߴٴ  ϰ ִ.  

tunelp α׷ ̿ϸ Ʈ(root) αؼ lp ̽
ͷƮ  (interrupt usage), (polling rate)  Ÿ
ɼ   ִ. 

Ŀ 2.0, Ǵ 1.3.x Ŀμӿ lp ̹ Ե , Ŀ
ͷƮ  ּҸ ϱ  " lp = " ɼ Ѵ. 

lp ̹ Ŀο ԵǾ , LILO/LOADLIN ɾ ̿ؼ
̹  Ʈ ּҿ ͷƮ   ִ.   

: lp=port0[,irq0[,port1[,irq1[,port2[,irq2]]]]]
: lp=0x378,0 or lp=0x278,5,0x378,7 **

  ̿ , ϱ ϴ  Ʈ ؾ Ѵ.

⺻ (default) . lp=0  ϸ Ŀ ̹
Ұ(disable)   ִ. 

Ŀ 2.0  1.3.x Ĺݺ Ŀο   , insmod ɾ
ɼǿ LILO/LOADLIN ó  ּҿ ͷƮ   
ִ. (Ǵ /etc/conf.modules ־ kerneld ϵ ) 
Ű(parameter) io=port0,port1,port2 irq=irq0,irq1,irq2 ̴.

⿡  ڼ  insmod  ϶.

**(ó)   ǥ Ʈ ȣ ã     
°  Ȳ ̴.  Ʈ(lp0) ּ 0x3bc̴.  
Ʈ Ϲ ϴ ͷƮ ؼ ˰  ʴ. 

3.2.  Ʈ ̽(Serial devices)

  Ʈ  ̽ /dev/ttyS1  
̸  ִ. stty α׷ ̿Ͽ Ʈ ¸
ų    ִ; setserial ̿ϸ   Ȯ
Ư , ުǥ Ʈ IRQ   ּ   
ִ.   Ʈ   ڷ Serial-HOWTO
<http://sunsite.unc.edu/mdw/HOWTO/Serial-HOWTO.html>. ã 
ִ. 

帧 (flow control)·    ͸  ,
۾    κ ߷   ߰ 
ִ. ̷   Ʈ  ġ Ʈ  , 30
̳ ۾ȿ ִ  ġ  ڿ(characters) 
  Ʈ ⺻ Ư¡ ã  ִ. ۴ 4096
ڿ   ,  Ͱ 帧 ϰ, ش
 Ʈ Ʈ   30 ̳   ڷḦ 
   ٸ, ۿ    شϴ 
κ  Ҿ ̴. ``cat file1 > /dev/ttyS?'' 
,     µǰ ū   ߷ µǸ,
   ȯ濡 ó ִٰ   ִ.  ioctl() call ̿ϴ
Ʈ ڷᱸ "closing_wait" ̿ϸ 30  
 ִ. Setserial ̷ Ҹ   , 
 ٸ  ó  ִ. , closing_wait ϱ
  setserial ϴ  ϴ. rc.serial  Ͱ
 Ʈ  setserial  ߰/Ѵ. ̷ Ͽ
Ư Ʈ closing_wait  ٸ  ÿ   ִ.   

4. ¿ α׷  ִ°?(Which spooling software?)

ֱٱ   ߴ. -  BSD Net-2 
״   lpd ߴ. ֱٿ ټ ڵ 
α׷ ִ´. ׷, ȭ  ̰ ִ. (Sun)
ֶ󸮽(Solaris) SVR4 迭 ýۿ  ٸ ¿ α׷
(print spooling package) ̰ ִ. Ϻ  ü LPRng -
Ӱ  ϸ,  ֽ  α׷ Ű - 
Ϸ ȣ ִ. LPRng Ը ġ ,  ξ ϰ
lpd  ϱ .   

  о ɼ ,   lpd κ
鿡  ֻ ̴. ġ ٷο ý
ƴ϶       ư, lpd Ƽ
н Ϸ  å  о̰   ִ. 

LPRng ؼ  ִٸ LPRng - An Enhanced Printer Spooler -
Ȩ  캸. 
<http://ltpwww.gsfc.nasa.gov:81/ltpcf/about/unix/Depotdoc/LPRng/>. 

    LPRng  lpd 뿡  ڷḦ Բ
 ̴. 

5. ۾ ⺻(How it works, basic)

۾  Ƿ,  lpd ý ؾ Ѵ. lpd Line
Printer Daemon ǹϸ, (context) ľ  daemon Ǵ
۾ õ α׷ ü  ص  ִ. 
 ޵ ¿ õ α׷̴. 

lpd

Ǯ Daemon. lpd ϳ   ()۾  ϸ, ٸ
ϳ  ۾ ϳ ȴ. 

lpr

  ɾ. lpr lpd Ͽ   ۾ Ǯ
(丮) ִ´. 

lpq

Ʈ ť(queue) ִ ۾  ش.

lpc

lpd ý  ɾ. lpc ̿ؼ Ʈ ť ۾ ,
, ,Ÿ  ϴ. 

lprm

Ǯ(丮) ۾ Ѵ.  ׷, ̵ 
ȣۿϴ°? ý õǸ, lpd ȴ. 

lpd /etc/printcap  ˻Ͽ Ǯ۾ ʿ Ͱ
ǵǾ ִ ˾ .   lpr  , lpr
/dev/printer  ̸  (socket) lpd ϰ lpd
   , ¹    Ѵ. ׷
lpd  ش Ͽ µ ǵ ͷ , Ѵ.   

 lp ý κ Ͱ line printer  - 
ascii text ȭ ַ ϴ  -  ߵǾ. ȯ ޶
 lpd  ư ؼ ణ ũƮ ۾ ʿϴ.
 ȯ PostScript, text, dvi پ  ִ..   

6. ⺻ ȯ漳 (How to set things up, basic)

6.1. Ϲ lpd (Traditional lpd configuration)

lpd ּ  ؼ ý ȭ Ʈ ť  
 ִ.   ش  Ͱ   ִ , 
    ִ° ؼ   ʾҴ.
׷,  ⺻ ̴ܰ.  о !  ⺻, lpd
Ʈ ť ߰Ϸ /etc/printcap   ؾ ϸ,
/var/spool/lpd ο Ǯ 丮  Ѵ. 

/etc/printcap    .

# LOCAL djet500
lp|dj|deskjet:\
:sd=/var/spool/lpd/dj:\
:mx#0:\
:lp=/dev/lp0:\
:sh:

  lp, dj, deskjet̶ () ͸ ϸ,
/var/spool/lpd/dj 丮 ڷḦ ӽϰ, (۾) ִ
ũ Ѱ谡 , ̽ /dev/lp0 ڷḦ Ѵ. ׸,
ش ۾ ʿ ߰Ǵ banner page -  ۾  
Ÿ  Ѵ. -  . 

printcap  ڼ о  Ѵ.

    , (catch) ִ - DeskJet 500
     ٸ, ʹ ̻(?) 
 ̴.    unix   DeskJet ͷ 
 newline ״ о鿩   Ѵ.( ) 

This is line one.
   This is line two.
      This is line three.

PS(PostScript  PS)  ̷ Ǯ  ϸ ̻ڰ
 PSɾ ܶ   ̴.8^)   ޵
(staircase effect) Բ... 

и   ʿϴ. ̸ ؼ (filter) ȴ.  

printcap    ̶ spool Ư¡ ``if''
``of'' ָ ̴. ⼭ if - input filter -  츮  ʿ
κ̴. 

newline  CR(Carriage Returen) ϴ ũƮ Ѵٸ
 ذ  ִ. ׷Ƿ,  printcap 뿡 if 
ϴ  ߰ؾ Ѵ. 

lp|dj|deskjet:\
:sd=/var/spool/lpd/dj:\
:mx#0:\
:lp=/dev/lp0:\
:if=/var/spool/lpd/dj/filter:\
:sh:

  ũƮ  ó ۼϸ ȴ. (Ʒ
ũƮ perl ̿ߴ.) 

#!perl
while(<STDIN>){chop $_; print "$_\r\n";};

 ô Ѵٸ, Ϲ н ؽƮ    ִ
Ǯ ȯ   ̴. (  ͸ ۼϴ  鸸
 ,  ⿡    ̴.  ۾ 
 ȿ   ֵ  ) 

 Ϲ ؽƮ   θ ֿǴ  ƴ϶ 
ִ. - Ƹ PS ٸ  (dvi)̳ ׷
ϵ   ־  ̴. ߿ ̸, 
ȯ漳 .   line-feed  Ȯ ¸ ϸ
ȴ. 

½ Էµ  ¸ Ͽ DeskJet ޾Ƶ  ִ
 ȯ ִ ͸ ۼѴٸ,  Ǹ  ȯ 
̴. 

Ϲ , ڱ⸸ ͸ ۼϷ ־ . ͳݿ
 Ͱ η ֱ ̴. 

6.2.  (File Permissions)

ٸ  Ź   ڽ  ѿ  
߰ߴ.     ſ . SGID  ̳ʸ
ϰ õ  ͵ SUID root  ʴ  
̴̻.    ڽ ̸,    ư.   

-r-sr-sr-x 1 root    lp      /usr/bin/lpr*
-r-sr-sr-x 1 root    lp      /usr/bin/lprm*
-rwxr--r-- 1 root    root    /usr/sbin/lpd*
-r-xr-sr-x 1 root    lp      /usr/sbin/lpc*
drwxrwxr-x 4 root    lp      /var/spool/lpd/
drwxr-xr-x 2 root    lp      /var/spool/lpd/lp/

 lpd lp  Ʈ ε(bind)ϱ ؼ root  Ǿ
Ѵ. bind UID lp ٸ  Ǿ ϰ, ׷ ʿ
  . Bummer....   

7.   ϱ(How to obtain an appropriate magic filter)

(:Ͷ ڰ ۾ Ű澲 ʾƵ پ ϵ
ó  ִ ٿ뵵  α׷ Ǵ Ű ǹѴ.)  

7.1 APS (APS Filter)

  α׷ Ѱ̸ Andreas Klemm
̴. lsm(Linux Software Map)   . 

Begin3
Title: apsfilter
Version: 4.9.1
Entered-date: Montag, 10. Juli 1995, 21:22:35 Uhr MET DST
Description: magicfilter for lpd with auto filetype detection
Keywords: lpd magicfilter aps apsfilter
Author: andreas@knobel.GUN.de (Andreas Klemm)
Maintained-by: sledge@hammer.oche.de (Thomas Bueschgens)
andreas@knobel.GUN.de (Andreas Klemm)
Primary-site: sunsite.unc.edu
/pub/Linux/system/Printing/
211KB aps-491.tgz
Original-site: ftp-i2.informatik.rwth-aachen.de
/pub/Linux/pak/APSfilter/aps-491.tgz
Platforms: C-Compiler, gs Postscript emulator, pbmutils
Copying-policy: GPL
End

APS ʹ  ť if ͷ ġǸ, پ  
شͿ  ɾ ȯϸ, Ϲ ؽƮ , PS, dvi, gif
 Ѵ. 

7.2.  (Magic-filter)

B.A.McCawley ۼ  ʹ APS Ϳ   ,
bash  ũƮ ۼǾ   ȭϱ ϴ. 

 LSM̴.

Version: 0.4
Description: Bash scripts to simplify the task of configuring lpd to
auto-detect file types using /etc/magic. (As advertised in the
printing-HOWTO). 
This package uses existing filters so it only prints file types for
which one already has filters (or compressed versions
thereof). Alterative magic filter approches are described in the
printing-HOWTO. 

Keywords: lpd, /etc/magic, printing, filter
Author: B.A.McCauley@bham.ac.uk (Brian McCauley)
Maintained-by: B.A.McCauley@bham.ac.uk
Primary-site: tsx-11.mit.edu pub/linux/sources/usr.bin
magic-filter-0.4.tar.gz 5709
Copying-policy: GNU GPL

7.3   ..

magic filter ̸ Ű   ־  򰥸
. (ƴϸ    α׷ΰ?)  LSM̴. 

Title: magicfilter
Version: 1.1b
Entered-date: 04APR95
Description: A customizable, extensible automatic printer filter.
Lets you automatically detect and print just about any data type you
can find a conversion utility for. This filter is written in C and is
controlled completely from an external printer configuration file.
This version adds automagic creation of configuration files based on
the installed software on your system, courtesy of GNU Autoconf. 
This version is a bug fix from 1.1/1.1a; filters for non-ASCII capable
PostScript printers have been added.   
Author: H. Peter Anvin <Peter.Anvin@linux.org>
Primary-site: sunsite.unc.edu
53000 /pub/Linux/system/Printing/magicfilter-1.1b.tar.gz
Copying-policy: GPL

8. lpd ȯ  Ʈ 

8.1. printcap 

8.2. ڷḦ Ҿ   

** :  Ʈ    κ  Ƚϴ.(
ܽŲ   
a)   Ʈ  뿡 ؼ ϰ
b)  Ʈ Ǵ Ʈ ͵ θ Ȱǰ ְ
c)    κ  ϴ 
** ϴ ͺ  **    ־ϴ.

 Ʈ   ؼ Ͻ е  Print Setup
HOWTO Ͻñ ٶϴ.) 

9. Ǹž α׷(Vendor Solutions)

 (section)  ϰ ߴ. (  ϰ 
̴.. ^^)  ϴ   ȯ濡  ڷḦ δ
 ȴ.   

9.1.  2.x and 3.0.3 (Picasso)

(:  4.2  ֱ  ϶)

(RedHat)  local remote ͸ ߰/  ִ
GUI ȯ(X ) "  (printer administration tool)"
 ִ.   ̿ؼ ghostscript ϴ    
ǥ(target)  н ̽    ,  
/etc/printcap  ͸   ִ. ׸ , ghostscript
 nenscript ̿Ͽ PS Ϲ ƽŰ  óϴ 
͸ ۼ  ִ.  ̷   ۵Ǹ, 밳 
ȯ漳 ʿ. 

  ֱ (Rembrant II) LPRng ϴ 
. ڴ  Rembrandt  ߴ.. 

9.2.   (Other Distributions)

ڿ ٸ 鿡  ڷḦ  ֱ ٶ.

10. Ʈ  ͸ ̿Ͽ ϱ

(How to print to a printer over the network)

lpd Ʈ  ٸ 迡  ͸ ؼ ϴ
 Ѵ.    ƿƼ ̿Ѵٸ  Ʈ
ȯ濡 lpr ̿ؼ    ִ. 

10.1. н/lpd ȣƮ  (To a Unix/lpd host)

 谡   ڽ  ͷ ϴ 
㰡Ϸ /etc/hosts.equiv /etc/hosts.lpd ش( ּҳ
̸) ؾ Ѵ. 

(hosts.equiv ٸ  ϴ ȣƮ ̸  ִ. 
踦 Ѵٸ ϰ ϶) /etc/printcap "rs" Ư ̿Ͽ
ٸ  Ư ڸ  Ϳ   ֵ  
ִ; ⿡  ڼ  lpd  ϶. 

10.2. lpd ̿ (With lpd)

ٸ  Ϸ /etc/printcap   ؾ Ѵ.

# REMOTE djet500
lp|dj|deskjet:\
:sd=/var/spool/lpd/dj:\
:rm=machine.out.there.com:\
:rp=printername:\
:lp=/dev/null:\
:sh:

remote machine ϴ 쿡 lpd ư local machine
(ڽ  ڽ) Ǯ丮 Ѵٴ  ָ϶.  
remote machine ٸ ۾ ٻڰų   ¶ local
machine  Ʈ ۾ Ǯ (. Ǯ丮)
ϰ ִٰ   ٽ ۵ȴ. 

10.3 rlpr ̿(With rlpr)

lpd ȯ ϴ ġ  ĥ ʿ  rlpr ̿Ѵٸ
 Ʈ ۾ ٷ(directly) remote machine Ʈ ť
 Ѵ.    ͸ ϴ ȯ濡
ϴ. 

rlpr ǥ οϸ:

rlpr TCP/IP  ̿Ͽ Ʈ ۾ Ʈ  ġ 
ʰ lpd    ִ.  lpr ޸ ۾ ϴ 
迡(local machine)  (remote machine) ϵ(
 /etc/printcap) ʿ䰡 . , rlpr   ϰ
()  ϴ. rlpr lpr Ǵ  ȯ濡
밡ϸ,  BSD lpr ȣȯ(backwares compatible)
. rlpr Ǹ  Ư ýۿ ؼ   ʿ 
 / ϴٴ ̴.   lpró ͷ
۵Ͽ  迡 Ǵ netscape, xemacs  Ŭ̾Ʈ
α׷ local machine    ִ. rlpr
Ʈ(SunSite)   ִ.   
<ftp://sunsite.unc.edu/pub/Linux/system/Printing/>.

10.4.  95/NT, LanManager, Samba  ͷ 

lpd ť ִ Ʈ ۾  smbclient (sambaŰ Ϻ)
 ̿ؼ TCP/IP SMB Ʈ    ϴ.samba
Ű smbprint ũƮ  ̿ϸ ȴ.  ϸ,
Ǯ 丮 Ư Ϳ    ְ, smbprint ũƮ
 /etc/printcap "if" ġϸ ȴ.   
/etc/printcap    ̴.

lp|remote-smbprinter:\
:lp=/dev/null:sh:\
:sd=/var/spool/lpd/lp:\
:if=/usr/local/sbin/smbprint:

smbprint ũƮ Ե  ݵ о   Ѵ. lpd
ʿ  ʰ smbclinet ̿Ͽ SMB printing   
ϴ  ϴ. ڼ   ϶. 

10.5 Ʈ  (To a NetWare Printer)

"ncpfs" Ű Ե nprint NetWare ȯ濡 smbprint 
 Ѵ. ncpfs <ftp://linux01.gwdg.de/pub/ncpfs/>  
 ִ.   

 LSM ̴.

version 0.16:
With ncpfs you can mount volumes of your netware server under
Linux. You can also print to netware print queues and spool netware
print queues to the Linux printing system. You need kernel 1.2.x or
1.3.54 and above. ncpfs does NOT work with any 1.3.x kernel below
1.3.54.   

lpd Ͽ nprint ۵ϱ ؼ NetWare( )ͷ
(ǥ) ѱ   ũƮ ۼϿ ̰ lpd  ť
 "if" ġؾ Ѵ.    ̴. 

sub2|remote-NWprinter:\
:lp=/dev/null:sh:\
:sd=/var/spool/lpd/sub2:\
:if=/var/spool/lpd/nprint-script:

nprint-script   .

#! /bin/sh
/usr/local/bin/nprint -S net -U name -P passwd -q printq-q
-

10.6 EtherTalk () ͷ (To an EtherTalk (Apple) printer)

netatalk Ű nprint smbclient   ϴ α׷
ִ.   
Werner Eugster   Ʈ    
ڼ ϰ ִ.  Ȩ ϶. 

<http://garnet.berkeley.edu/~weugster/appleprint.html>

Ȯ  ҹ : Netatalk DEC tulip Ĩ  SMC Etherpower
PCIī忡 ۵ ʴ´ٰ Ѵ. 

10.7. HP  Ÿ Ʈ ͷ (To an HP or other ethernet printer) 

HP Ϻ Ϳ ִ ethernet ̽ ̿ϸ lpd ̿ؼ
ڷḦ  /  ִ. ͳ ̴ Ϳ Ե
Ŵ  ڼ а  ô  ȴ.  ̵ ʹ
lpd  ϸ鼭 ϳ ̻   ť Ѵ. HP ǰ
  /etc/printcap   ִ. 

lj-5|remote-hplj:\
:lp=/dev/null:sh:\
:sd=/var/spool/lpd/lj-5:\
:rm=printer.name.com:rp=raw:

Ը ū , Ư  Ͱ PS   ŭ ũٸ,
 print server ϰ     ۾ Ͽ
  Ghostscript ۾ Ǿ óǴ  ٶϴ.   

10.7.1.  HP ǰ(To older HPs)

Ϻ (Ǵ "ڽ" Īϴ Ʈ ǰ)  TCP
Ӱ ǥ ƴ  Ѵ. ̷ ֿ ϴ
ǰ JetDirect ʱ (Ϻ JetDirectEx ǰ ) ִ. 

⺻, ̵ ͷ Ϸ Ư Ʈ (ַ 9100) tcp
 Ͽ  ۾ ڷḦ ϸ ȴ. ̰ ϴ  
 ,  Perl ̿޴. 

#!/usr/bin/perl
# Thanks to Dan McLaughlin for writing the original version
of this
# script (And to Jim W. Jones for sitting next to Dan when
writing me
# for help ;)
$fileName = @ARGV[0];
open(IN,"$fileName") || die "Can't open file
$fileName";
$dpi300 = "\x1B*t300R";
$dosCr = "\x1B&amp;k3G";
$ends = "\x0A";
$port = 9100 unless $port;
$them = "bach.sr.hp.com" unless $them;
$AF_INET = 2;
$SOCK_STREAM = 1;
$SIG{'INT'} = 'dokill';
$sockaddr = 'S n a4 x8';
chop($hostname = `hostname`);
($name,$aliases,$proto) = getprotobyname('tcp');
($name,$aliases,$port) = getservbyname($port,'tcp')
unless $port =~ /^\d+$/;;
($name,$aliases,$type,$len,$thisaddr) =
gethostbyname($hostname);
($name,$aliases,$type,$len,$thataddr) = gethostbyname($them);
$this = pack($sockaddr, $AF_INET, 0, $thisaddr);
$that = pack($sockaddr, $AF_INET, $port, $thataddr);
if (socket(S, $AF_INET, $SOCK_STREAM, $proto)) {
# print "socket ok\n";
}
else {
die $!;
}
# Give the socket an address.
if (bind(S, $this)) {
# print "bind ok\n";
}
else {
die $!;
}
# Call up the server.
if (connect(S,$that)) {
# print "connect ok\n";
}
else {
die $!;
}
# Set socket to be command buffered.
select(S); $| = 1; select(STDOUT);
# print S "@PJL ECHO Hi $hostname! $ends";
# print S "@PJL OPMSG DISPLAY=\"Job $whoami\"
$ends";
# print S $dpi300;
# Avoid deadlock by forking.
if($child = fork) {
print S $dosCr;
print S $TimesNewR;
while (<IN>) {
print S;
}
sleep 3;
do dokill();
} else {
while(<S>) {
print;
}
}
sub dokill {
kill 9,$child if $child;
}

10.8 remote printer if  (Running an if for remote printers)

lpd Ư¡  (remote printer) "if" 
ʴ´ٴ ̴. "if" ϱ ؼ ΰ ͸ ϰ
 ۾ ѹ  óѴ. ׷   printcap
϶.   

lj-5:remote-hplj:\
:lp=/dev/null:sh:\
:sd=/var/spool/lpd/lj-5:\
:if=/usr/lib/lpd/filter-lj-5:
lj-5-remote:lp=/dev/null:sh:rm=printer.name.com:\
:rp=raw:sd=/var/spool/lpd/lj-5-raw:

filter-lj-5 script   .

#!/bin/sh

gs <options> -q -dSAFER -sOutputFile=- - | \
lpr -Plj-5-remote -U$5

-U ɼ lpr (纻)lpr (daemon) ǰ ִٸ
ó     ̸ ٽ óǴ  ۾ 
ϰ ȴ. username ޴    (robust)
   ̴. ֳϸ Ư  $5(argument 5) ƴҼ
ִ. 
printcap  ϶.

11. ѽ 

11.1. ѽ  (Using a faxmodem)

ѽ ̿Ͽ  ۽/  ִ α׷ 
ִ. ̰͵   پ    Sam Leffler  HylaFax
̸ ftp.sgi.com    ִ.   ϸ
broadcasting  Ѵ.   
κ  ڽ θ Ǵ α׷ efax ִ. efax
 fax   α׷̴. getty α׷  mgetty 
fax   ִ.(Ϻ Ư 𵩿 voicemail Ѵ.)  

11.2.    ̿(Using the Remote Printing Service)

e-mail  fax ϴ  ִ  񽺰 ִ.
(: κ ISP ϴ ͳ ѽ 񽺿 ) PS
   ȴ. 踦  ϴ 񽺴 
 ,    񽺴. ڼ  FAQ
϶.<http://www.town.hall.org/fax/faq.html>. 

12. ¿  (How to generate something worth printing)

⿡  α׷ Ұȴ. ⺻  4 
̳ʸ   ( ̴ ) ų  ִ: Linux,
iBCS, Win16/Win32s (dosemu Ǵ wine ̿), Mac/68k (Executor ̿)
( :  Ϻ  alpha sparc õǾ Ǹŵǰ
ִ.) 

⼭ Linux (native) α׷ Ϲ н α׷
ؼ ϰڴ. SCO  ó iBCS ķ̼ ؼ 
۵ϴ  α׷ ܷ ϰڴ.   

  Unix ȯ濡   Ǵ α׷
  ѵȴ.   

12.1. ũ  (Markup languages)

κ markup language Ը Ǵ ݺ Ʈ  -
 ü 帧(layout) ǻͷ Ͽ ϰ 帧  -
  ̴. markup language ̿ؼ   
ϴ    ʿ Ѵ... 

nroff

nroff н  markup language Ѵ.   *roff
ũη  ǥ ̴.   ̸ ,
norff , Դ , ʿ̻ ϰ ο ۾
 ʴ. ׷ ұϰ, ︸ ġ ִ. groff
̿Ͽ  PS   ȯ  ִ. man -t foo | lpr
 man ɾ ̿ϸ ȴ. 

TeX

(TeX), ׸ ũ Ű (LaTeX) н 迡 θ
Ǵ markup language.   ۹ LaTeX  
ۼǴµ, ̴ (LaTeX)  ü (layout)  ϰ
ϸ,  ǥ  ϴ óý (text processing
system)̱ ̴.  TeX ¹ dvi(Device Independent) ̸
PS HP (Hewlett Packard) PCL(Printer Control Language) ȯ 
ִ. (dvips dvilj)  

SGML

Unix Linux free sgml parser   ִ.  ̰
Linuxdoc-SGML   ý ⺻ Ѵ.   ٸ DTD
Ѵ.   

HTML

 ϱ,  Ʈ HTML ۼϿ Netscape 
  ̾.  ⿡  . YMMV  

12.2. (WYSIWYG)

  Ȱ ִ ó α׷̴.  ,
 ߸ 뿡 ؼ ˷޶.   

LyX

LyX LaTeX front-end̸  ɼ  α׷̴. ڼ
 LyX Ȩ ϶. 
<http://www-pu.informatik.uni-tuebingen.de/users/ettrich/>

The Andrew User Interface System(AUIS)

AUIS  Ÿ̸   μ   ez
 ⸦ ϰ ִ. HTML MIME email  newsgroup
Ѵ. 

 α׷

Caldear Red Hat  Ÿ μ Ʈ
α׷   繫 α׷  ǸѴ.  Ƹ 
͵ ,     ߴ. 

Caldera (Sun) ͺ(Wabi) ǸѴٰ . ׷Ƿ 
  ۾ؾ Ҷ, MS Office  α׷  
  ̴. 
(:ͺ (Sun) Ǹϴ н MS Windows ķ̴.)

Jeff Phillips <jeff@I_RATUS.org> Caldera Linux
WordPerfect( ġ)   װ  ۵Ѵٰ
ߴ.   α׷ ٸ̵   ü ͸
ߴ. 

Caldera <http://www.caldera.com/> ڷḦ ϰ ִ.  

RedHat Applixware ǽ Ű ǸѴ.  Ʈ
<http://www.redhat.com/>  ڷḦ ã .   

  ü (ִٸ) ڻ ǰ  ڷḦ  ޶.


13. Ghostscript

Ghostscript  ۾ ſ ߿  ϴ
α׷̴.  н  α׷  PS  ϴµ,
 Ϳ PS  ϱؼ $100 ~ $300  ߰
 .  (:    ٸ ̴.) ׷, 
  ִ Ghostscript ̿Ͽ  Ϳ PS  
 ִ. 

/etc/printcap "if" Ϳ   Ѵٸ PostScript
ϴ ͸  ó ۾  .   

Ghostscript 2 · Ҽ ִ.  Aladdin
Ghostscript ο(for personal use)  , 
  Խ   .   GNU Ghostscript
  1    ִ. 

  Aladdin  Adobe Acrobat PDF(Portable Document
Format) Ѵ. 

Ghostscript free  GNU Ghostscript Ҹ, 1 
 Aladdin Ghostscript GNU  ̴. (Aladdin
̷   Ѵ.   Ʈ ü ̷ 
free Ʈ ؾ Ѵ.) 

Ghostscript ִ  Ʈʿ  ۲ÿ ִ. ׷
Ghostscript Adobe type 1 ۲ ν  ,  ۲ 
   ִ. Adobe  ۲ Acrobat PDF reader
α׷ Բ ϰ  ATM(Adobe Type Manager) ۲
(fontpack)   ִ. 

Ghostscript ۾  -dSAFER ɼ(file   )  
϶. PostScript ʹ    ֱ  ߸ PS
α׷  ǰϰ   ִ.   

13.1 Ghostscript ¹  ġ (Ghostscript output tuning)

Ghostscript ¹  ϴٸ, װ ϴ  
ִ.(ҽڵ尡 ǹǷ   ϴ.) 

13.1.1. ¹ ġ ũ(Output location and size)

ġ, ũ, ̹  Ghostscript Ե ش  ̹
  ȴ.  ̰ ʹ ªų  , Ǵ 2 
  ʸ ũ     , ̹ ҽ 
캻  Ư Ű(parameter) Ը ϸ ȴ. 

Ե,  ̹  ٸ   Ƿ
ü   ãƾ Ѵ. , ü ּ  ؼ 
Ǿ ִ. 

13.1.2. Gamma, dotsizes, etc.

 Ͱ ƴ (ũ, Ʈ) ¹ Ÿ 
ũ ü  ¹  ũ. ̶ ׷ ¹
ʹ ο .   ذϷ   ̿ؾ Ѵ.
Ʒ  Ghostscript lib丮   gs  Ư
 óϱ⿡ ռ    о̵ gs ̸
߰Ѵ. ü ġ  Ϳ 缭 ص . ġ
ϼ ()   µȴ. Ư,  ִ Ͱ
Floyd-Steinberg ˰ Ѵٸ 0.2 - 0.15   ϴ
 .   

---8<---- gamma.ps ----8<---
%!
%transfer functions for cyan magenta yellow black
{0.3 exp} {0.3 exp} {0.3 exp} {0.3 exp} setcolortransfer
---8<------------------8<---

  ؼ ϴ  ÷ ½ Ϳ ջ 
ɼ ִ. ׷Ƿ colorcir.ps  ̿ؼ ׽Ʈϵ 
Ѵ. (  ghostscript ġ  examples/丮 ִ)  

14.  ̸ (On-screen previewing of printable things)

κ ¹ ȭ  ̸ 캼  ִ.

14.1. PostScript

Ghostscript Ghostview X11̹ ؼ PS  X
ȭ󿡼 캼  ִ. (: gv  α׷ 
ϴ)  ֽ  PDF ϵ ó  ִ. 

14.2. TeX dvi

TeX ¹ DVI(DeVice Independant)  ̸   ؼ
xdvi X11 α׷ ̿Ѵ. ֱ  xdvi PS κ 
ǥϱ ؼ ghostscript ȣ  ִ.  vt100 ̹
ִ. dgvg Ҹ. tmview Linux  svgalib  ۵Ѵ. 

15.  ֽ е(Credits)

smbprint   Marcel Roelofs<marcel@paragon.nl>  ۿ
Դ. 
Netware Ϳ nprint   Michael Smith
<mikes@bioch.ox.ac.uk>  ̴. 
lpdȯ  Ʈ Ϳ  κ Andrew Tefft ߴ. 
gamma  ghostscript   Andreas 
̴. <quasi@hub-fue.franken.de>.   
Chris Johnson <cdj@netcom.com> Ʈ 30ʰ closing_wait
ٷ ΰ ܶ  ־. 
