FreeBSD Operating System

Printers

Показывать лекцию целиком

In this chapter, we'll look at some aspects of using printers with FreeBSD. As a user, you don't access printers directly. Instead, a series of processes, collectively called the spooler, manage print data. One process, lpr, writes user print data to disk, and another, lpd, copies the print data to the printers. This method enables processes to write print data even if the printers are busy and ensures optimum printer availability.

In this section, we'll look briefly at what you need to do to set up printers. For more details, look in the online handbook section on printing.

lpd is the central spooler process. It is responsible for a number of things:

  • It controls access to attached printers and to printers attached to other hosts on the network.
  • It enables users to submit files to be printed. These submissions are known as jobs.
  • It prevents multiple users from accessing a printer at the same time by maintaining a queue for each printer.
  • It can print header pages, also known as banner or burst pages, so users can easily find jobs they have printed in a stack of printouts.
  • It takes care of communications parameters for printers connected on serial ports.
  • It can send jobs over the network to another spooler on another host.
  • It can run special filters to format jobs to be printed for various printer languages or printer capabilities.
  • It can account for printer usage.
  • Through a configuration file, and by providing the special filter programs, you can enable the spooler to do all or some subset of the above for a great variety of printer hardware.

    This may sound like overkill if you are the only user on the system. It is possible to access the printer directly, but it's not a good idea:

  • The spooler prints jobs in the background. You don't have to wait for data to be copied to the printer.
  • The spooler can conveniently run a job to be printed through filters to add headers or convert special formats (such as PostScript) into a format the printer will understand.
  • Most programs that provide a print feature expect to talk to the spooler on your system.
  • Printer configuration

    There are three commonly used ways to connect a printer to a computer:

  • Older UNIX systems frequently used serial printers, but they are no longer in common use. Serial printers seldom transmit more than 1,920 characters per second, which is too slow for modern printers.
  • Most printers are still connected by a parallel port. Parallel ports enable faster communication with the printer, up to about 100,000 bytes per second. Such speeds may still not be enough for complex PostScript or bit-mapped images. Most parallel ports require CPU intervention via an interrupt for each character transmitted, and 100,000 interrupts per second can use the entire processing power of a fast machine.
  • More modern printers have USB or Ethernet interfaces, which enable them to connect to several machines at once at much higher speeds. The load on the host computer is also much lower.
  • It's pretty straightforward to connect a parallel printer. You don't need to do anything special to configure the line printer driver lpt: it's in the kernel by default. All you need to do is to plug in the cable between the printer and the computer. If you have more than one parallel interface, of course, you'll have to decide which one to use. Parallel printer devices are called /dev/lptn, where n is the number, starting with 0. USB devices have names like /dev/ulptn. See Table 10-4 on page 195 for further details.

    Configuring an Ethernet-connected printer is more complicated. You obviously need an IP address, which you configure on the printer. Most modern printers then appear like a remote computer to the spooler. We look at spooling to remote computers on page 266.

    Testing the printer

    When you have connected and powered on a parallel port printer, run the built-in test if one is supplied: typically there's a function that produces a printout describing the printer's features. After that, check the communication between the computer and the printer.

    # lptest > /dev/lpt0
    

    If you have a pure PostScript printer, one which can't print anything else, you won't get any out put. Even here, though, you should see some reaction on the status display.

    Configuring /etc/printcap

    The next step is to configure the central configuration file, /etc/printcap. This file is not the easiest to read, but after a while you'll get used to it. Here are some typical entries:

    lp|lj|ps|local LaserJet 6MP printer:\
      :lp=/dev/lpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:sh:mx#0:\
      :if=/usr/local/libexec/lpfilter:
    
    rlp|sample remote printer:\
      :rm=freebie:sd=/var/spool/output/freebie:lf=/var/log/lpd-errs:\
      :rp=lp:
    

    Let's look at this in detail:

  • All fields are delimited by a colon (:).
  • Continuation lines require a backslash character (\). Note particularly that you require a colon at the end of a continued line, and another at the beginning of the following line.
  • The first line of each entry specifies a number of names that you can use to specify this printer when talking to lpr or lpd. The names are separated by vertical bar symbols|. By tradition, the last name is a more verbose description, and you wouldn't normally use it to talk to programs.
  • The following fields describe capabilities, descriptions of how to do something. Capabilities are described by a two-letter keyword and optionally a parameter, which is separated by a delimiter indicating the type of parameter. If the field takes a string parameter, the delimiter is =, and if it takes a numeric value, the delimiter is #. You'll find a full description in the man page.
  • The first entry defines a local printer, called lp, lj, ps and local LaserJet 6MP printer. Why so many names? lp is the default, so you should have it somewhere. lj is frequently used to talk to printers that understand HP's LaserJet language (now PCL), and ps might be used to talk to a printer that understands PostScript. The final name is more of a description.
  • The entry lp=/dev/lpt0 tells the spooler the name of the physical device to which the printer is connected. Remote printers don't have physical devices.
  • sd tells the spooler the directory in which to store jobs awaiting printing. This directory must exist; the spooler doesn't create it.
  • lf=/var/log/lpd-errs specifies the name of a file in which to log errors.
  • sh is a flag telling lpd to omit a header page. If you don't have that, every job will be preceded by a descriptor page. In a small environment, this doesn't make sense and is just a waste of paper.
  • The parameter mx tells lpd the maximum size of a spool job in kilobytes. If the job is larger than this value, lpd refuses to print it. In our case, we don't want to limit the size. We do this by setting mx to 0.
  • if tells lpd to apply a filter to the job before printing. We'll look at this below.
  • In the remote printer entry, rm=freebie tells lpd to send the data to the machine called freebie. This could be a fully qualified domain name, of course.
  • In the remote printer entry, rp=lp tells lpd the name of the printer on the remote machine. This doesn't have to be the same name as the name on the local machine.
  • Remote printing

    In a network, you don't need to have a printer on every machine; you can print on another machine (which may be a printer) on the same network. There are a couple of things to consider:

  • There are two machines involved in remote printing, the client ("local") machine and the server ("remote") machine.
  • On the client, you specify the name of the server machine with the rm capability, and you specify the name of the printer with the rp capability. You don't specify any lp (device name) capability. A typical entry might look like this:
    lp|HP LaserJet 6MP on freebie:\
      :rm=freebie:sd=/var/spool/output/freebie:lf=/var/log/lpd-errs:mx#0:
    
  • On the client machine, you must also create the spool directory, /var/spool/out-put/freebie in the example above.
  • On the server machine, you don't need to do anything special with the /etc/printcap file. You need an entry for the printer specified in the client machine's rp entry, of course.
  • On the server machine you must allow spooler access from the client machine. For a BSD machine, you add the name of the machine to the file /etc/hosts.lpd on a line by it self.
  • Spooler filters

    Probably the least intelligible entry in the configuration file on page 265 was the if entry. It specifies the name of an input filter, a program through which Lpd passes the complete print data before printing.

    What does it do that for? There can be a number of reasons. Maybe you have data in a format that isn't fit to print. For example, it might be PostScript, and your printer might not understand PostScript. Or it could be the other way around: your printer understands only PostScript, and the input isn't PostScript.

    There's a more likely reason to require a filter, though: most printers still emulate the old teletypes, so they require a carriage return character (Ctrl-M or ^M) to start at the beginning of the line, and a new line character (Ctrl-J or ^J) to advance to the next line. UNIX uses only ^J, so if you copy data to it, you're liable to see a staircase effect. For example, may tell you:

    $ ps
     PID  TT  STAT     TIME  COMMAND
    2252  pi  Ss    0:01.35  /bin/bash
    2287  p1  IW    0:04.77  e/etc/printcap
    2346  p1  R+    0:00.05  ps
    

    When you try to print it, however, you get:

     PID  TT  STAT     TIME COMMAND
    2252  p1  Ss    0:01.35 /bin/bash
    2287  p1  IW    0
    

    The rest of the page is empty: you've gone off the right margin. There are a number of ways to solve this problem:

  • You may be able to configure your printer to interpret Ctrl-J as both new line and return, and to ignore Ctrl-M. Check your printer handbook.
  • You may be able to issue a control sequence to your printer to tell it to interpret Ctrl-J as both new line and return to the beginning of the line, and to ignore Ctrl-M. For example, HP Laser Jets and compatibles will do this if you send them the control sequence ESCk2G.
  • You can write an input filter that transforms the print job into a form that the printer understands. We'll look at this option below.
  • There are a couple of options for the print filter. One of them, taken from the online handbook, sends out a LaserJet control sequence before every job. Put the following shell script in /usr/local/libexec/lpfilter:

    #!/bin/sh
    printf "\033k2G"  cat  printf "\f"  exit 0 exit 2
    

    This approach does not work well with some printers, such as my HP LaserJet 6MP, which can print both PostScript and LaserJet (natural) formats at random. They do this by recognizing the text at the beginning of the job. This particular filter confuses them by sending a LaserJet command code, so the printer prints the PostScript as if it were plain text.

    In this kind of situation, the standard filters are no longer sufficient. You can solve the problem with the port apsfilter, which is in the Ports Collection.

    Starting the spooler

    As we saw above, the line printer daemon lpd is responsible for printing spooled jobs. By default it isn't started at boot time. If you're root, you can start it by name:

    # lpd
    

    Normally, however, you will want it to be started automatically when the system starts up. You do this by setting the variable lpd_enable in /etc/rc.conf:

    lpd_enable="YES"    # Run the line printer daemon
    

    See page 552 for more details of /etc/rc.conf.

    You can also add another line referring to the line printer daemon to /etc/rc.conf:

    lpd_flags=""    # Flags to lpd (if enabled).
    

    You don't normally need this line. See the man page for lpd for details of the fags.

    Testing the spooler

    To test the spooler, you can run the lptest program again. This time, however, instead of sending it directly to the printer, you send it to the spooler:

    $ lptest 80 5 | lpr
    

    The results should look like:

    !"#$%'()* + ,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_,abcdefghijklmnop
    "#$%'()* + ,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_,abcdefghijklmnopq
    #$%'()*+,-./0123456789:;<=>?@ABCDEFGHIJK^OPQRSTUVWXYZ[\]^_,abcdefghijklmnopqr
    $%'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_,abcdefghijklmnopqrs
    %'()*+,-./0123456789:;<=>?@ABCDEFGHIJK^OPQRSTUVWXYZ[\]^_,abcdefghijklmnopqrst
    

    Troubleshooting

    Here's a list of the most common problems and how to solve them.

    Common printer problems
    ProblemCause
    The printer prints, but the last page doesn't appear. The status shows that the printer still has data in the buffer. After several minutes, the last page may appear.Your output data is not ejecting the last page. The printer is configured to either wait for an explicit eject request (the ASCII Form feed character, Ctrl-L) or to eject after a certain period of time.

    You have a choice as to what you do about this. Usually you can configure the printer, or you could get the print filter to print a form feed character at the end of the job. Listing 15-1 already does this — that's the printf "\f".

    The lines wander off to the right edge of the paper and are never seen againThis is the staircase effect. Refer to page 268 for a couple of solutions.
    Individual characters or whole sections of text are missing.This problem occurs almost only on serial printers. It's a result of incorrect handshaking—see page 330 and the online handbook for more details.
    The output contained completely unintelligible random characters.On a serial printer ,if the characters appear slowly, and there's a predominance of the characters {|}~, this probably means that you have set up the communication parameters in correctly. Check the online handbook for a solution. Makes sure you don't confuse this problem with the following one.
    The text was legible, but it bore no relationship to what you wanted to print.One possibility is that you are sending PostScript output to your printer. See the discussion on page 271 to check if it is PostScript. If it is, your printer is not interpreting it correctly, either because it doesn't understand PostScript, or because it has been confused (see the discussion on page 268 for one reason).
    The display on the printer shows that data are arriving, but the printer doesn't print anything.You might be sending normal text to a PostScript printer that doesn't understand normal text. In this case, too, you will need a filter to convert the text to PostScript—the opposite of the previous problem.

    Alternatively, your printer port may not be interrupting correctly. This will not stop the printer from printing, but it can take up to 20 minutes to print a page. You can fix this by issuing the following command, which puts the printer /dev/lpt0 into polled mode:

    # lptcontrol -p
    You get the message lpr: cannot create freebie/.seqYou have forgotten to create the spool directory /var/spool/output/freebie.

    Using the spooler

    Using the spooler is relatively simple. Instead of outputting data directly to the printer, you pipe it to the spooler lpr command. For example, here is the same print command, first printing directly to the printer, and secondly via the spooler:

    # ps waux > /dev/lpt0
    $ ps waux | lpr
    

    Note the difference in prompt: you have to be root to write directly to the printer, but normally anybody can write to the spooler. The spooler creates a job from this data. You can look at the current print queue with the lpq program:

    $ lpq
    waiting for lp to become ready (offline ?)
    Rank  Owner   Job  Files             Total Size
    1st   grog    313  (standard input)  9151  bytes
    2nd   grog    30   (standard input)  3319m bytes
    3rd   Yvonne  31   (standard input)  3395  bytes
    4th   root    0    (standard input)  2611  bytes
    

    The first line is a warning that lpd can't currently print. Take it seriously. In this example, the printer was deliberately turned off so that the queue did not change from one example to the next.

    Normally, the job numbers increase sequentially: this particular example came from three different machines. You can get more detail with the -l option:

    $ lpq -l
    waiting for lp to become ready (offline ?)
    grog: 1st           [job 313freebie.example.org]
      (standard input)  9151 bytes
    grog: 2nd           [job 030presto.example.org]
      (standard input)  3319 bytes
    yvonne: 3rd         [job 031presto.example.org]
      (standard input)  3395 bytes
    root: 4th           [job 000bumble.example.org]
      (standard input)  2611 bytes
    

    Removing print jobs

    Sometimes you may want to delete spool output without printing it. You don't need to do this because of a printer configuration error: just turn the printer off, fix the configuration error, and turn the printer on again. The job should then be printed correctly. But if you discover that the print job itself contains garbage, you can remove it with the lprm program. First, though, you need to know the job number. Assuming the list we have above, we might want to remove job 30:

      lprm 30
    dfA030presto.example.org dequeued
    cfA030presto.example.org dequeued
      lpq
    waiting for lp to become ready (offline ?)
    Rank  Owner   Job  Files             Total Size
    1st   grog    313  (standard input)  9151 bytes
    2nd   yvonne  31   (standard input)  3395 bytes
    3rd   root    0    (standard input)  2611 bytes
    

    If the printer is offline, it may take some time for the lprm to complete.

    PostScript

    We've encountered the term PostScript several times already. It's a Page Description Language. With it, you can transmit detailed documents such as this book electronically and print them out in exactly the same form elsewhereThis is in fact the way this book was sent to the printers. PostScript is a very popular format on the World Wide Web, and web browsers like Netscape usually print in PostScript format.

    Most other document formats describe special print features with escape sequences, special commands that start with a special character. For example, the HP LaserJet and PCL formats use the ASCII ESC character (Oxlb) to indicate the beginning of an escape sequence. PostScript uses the opposite approach: unless defined otherwise, the contents of a PostScript file are commands, and the printable data is enclosed in parentheses. PostScript documents start with something like:

    %!PS-Adobe-3.0
    %%Creator: groff version 1.10
    %%CreationDate: Fri Oct 31 18:36:45 1997
    %%DocumentNeededResources: font Symbol
    %%+ font Courier
    %%+ font Times-Roman
    %%DocumentSuppliedResources: file images/vipw.ps
    %%Pages: 32
    %%PageOrder: Ascend
    %%Orientation: Portrait
    %%EndComments
    %%BeginProlog
    

    This is the prologue (the beginning) of the PostScript output for this chapter. The prologue of such a program can be several hundred kilobytes long if it includes embedded fonts or images. Amore typical size is about 500 lines.

    You can do a number of things with PostScript:

  • You can look at it with gv, which is in the Ports Collection. We'll look at this option below.
  • Many printers understand PostScript and print it directly. If yours does, you probably know about it, since it's an expensive option. In case of doubt, check your printer manual.
  • If your printer doesn't understand PostScript, you can print with the aid of ghostscript. The apsfilter port does this for you.
  • Viewing with gv

    gv is part of the instant workstation port that we discussed on page 93. To view a file with gv, simply start it:

    $ gv filename 
    

    If you don't specify a file name, you get a blank display. You can then open a file window by pressing o, after which you can select files and display them. Figure 15-1 shows the display of a draft version of this page with an overlaid open window at the top right. The Open File window contains a field at the top into which you can type the name of a file. Alternatively, the columns below, with scroll bars, allow you to browse the current directory and the parent directories.

    The window below shows the text of the previous page (roughly) on the right hand side. Instead of scroll bars, there is a scroll area below the text Save Marked. You can scroll the image in all directions by selecting the box with the left mouse button and moving around. At top left are menu buttons that you can select with the left mouse button. Note also the button 1.414 at the top of the window: this is the magnification of the image. You can change it by selecting this button: a menu appears and gives you a range of magnifications to choose from.

    The column to the right of these buttons is a list of page numbers. You can select a page number with the middle mouse button. You can also get an enlargement display of the text area around the mouse cursor by pressing the left button.

    (рис 15.1) gv display

    Printing with ghostscript

    If your printer doesn't support PostScript, you can still print some semblance of the intended text with the help of ghostscript. The results are very acceptable with modern laser and inkjet printers, less so with older dot matrix printers.

    To print on your particular printer, you first need to find a driver for it in ghostscript. In this context, the term driver means some code inside ghostscript that converts the data into something that the printer can print.

    We've already seen how to use /etc/printcap. In this case, we'll need an input filter, a script or program that transforms the PostScript data into a form that the printer understands. The entry in /etc/printcap is pretty much the same for all printers:

    ps|HP Office Jet 725 with PostScript:\
      :lp=/dev/lpt0:sd=/var/spool/output/colour:lf=/var/log/lpd-errs:sh:mx#0:\
      :if=/usr/local/libexec/psfilter:
    

    This entry defines a printer called ps. The comment states that it's an HP Office Jet, but that's only a comment. Obviously you should choose a comment that matches the printer you really have.

    The printer is connected to /dev/lpt0,the first parallel printer. Spool data is collected in the directory /var/spool/output/colour. You must create this directory, or printing will fail, and depending on what you use to print, you may not even see any error messages. They also don't appear on the log file, which in this case is /var/log/lpd-errs.

    The important entry is in the last line, which refers to the input filter /usr/local/libexec/ps-filter. This file contains the instructions to convert the PostScript into something that the printer can understand. For example, for the HP Office Jet we're talking about here, it contains:

    #!/bin/sh
    /usr/local/bin/gs -sDEVICE=pcl3 -q -sPaperSize=a4 -dNOPAUSE -sOutputFile=- -
    

    These options state:

  • Use ghostscript device pcl3. This is the driver to choose for most Hewlett Packard inkjet printers. We'll see alternatives for other printers below.
  • The output file is stdin (see page 127). By convention, a number of programs use the character - to represent the stdout stream.
  • -q means guiet. Normally ghostscript outputs a message on startup, and it often outputs other informative messages as well. In this case, we're using it as a filter, so we don't want any output except what we print.
  • Don't pause between pages. If you don't specify this parameter, ghostscript waits for a key press at the end of each page.
  • The paper size is the international A4 format. By default, ghostscript produces output for American standard 8.5 x 10 inch "letter" paper.
  • The character - by itself tells ghostscript that the input is from stdin. Together with the output to stdout, this makes ghostscript function as a filter.
  • Which driver?

    The previous example used the driver for the HP DeskJet. Well, to be more precise, it used one of a plethora of drivers available. You can find more information in the HTML driver documentation at /usr/local/share/ghostscript/7.05/doc/Devices.htm. The 7.05 in the name refers to the release of ghostscript, which will change.

    The documentation isn't the easiest to read. It's probably older than your printer, so there's a good chance that it won't mention your specific printer model. You may need to experiment a little before you get things working the way you want.

    Printer drivers for DeskJets

    There are at least six sets of drivers for HP DeskJets. They're all described in Devices.htm, but the following summary may help:

  • Hewlett Packard supply their own drivers. In addition to ghostscript, they require server software that you can install from the Ports collection (/usr/ports/print/hpijs).
  • Next come three different independently written drivers for specific models of DeskJet, probably all now obsolete. If you recognize your printer or something similar in one of them, that's a good first choice.
  • Next comes the generic pcl3 driver that was used in the example above. It's not mentioned in the documentation.
  • Finally, uniprint is a completely different driver framework for a number of different makes of printer. It requires a slightly different command line, and we'll look at it separately below.
  • If you're using a DeskJet, you have the choice. Unfortunately, there's no way to know which is best until you've tried them all. Similar considerations apply to other makes of printer.

    uniprint drivers

    The uniprint drivers have a somewhat different kind of interface. They're described towards the end of the same Devices.htm file. To use them, change the driver specification as in the following example, that refers to an Epson

    #!/bin/sh
    /usr/local/bin/gs @stc500ph.upp -q -sPaperSize=a4 -dNOPAUSE -sOutputFile=- - -c quit
    

    The differences here are:

  • The name of the driver (stc500ph.upp) is specified differently.
  • The line ends with a command to the driver it self (-c quit). The exact meaning is not documented, though it's easy to guess.
  • Which drivers?

    Another problem you might encounter is that it's possible to specify the drivers you want in your ghostscript executable when you build the port. It's quite possible that the drivers described in Devices.htm don't exist on your system. To find out, run ghostscript interactively with the -h (help) option:

    $ gs -h
    GNU Ghostscript 7.05 (2002-04-22)
    Copyright (C) 2002 artofcode LLC, Benicia, CA.   All rights reserved.
    Usage: gs  [switches]   [file1.ps file2.ps ...]
    Most frequently used switches:  (you can use # in place of =)
      -dNOPAUSE   no pause after page           -q       'quiet', fewer messages
      -g<width>x<height>   page size in pixels  -r<res>  pixels/inch resolution
      -sDEVICE=<devname>   select device        -dBATCH  exit after last file
      -sOutputFile=<file> select output file: - for stdout,   |command for pipe,
                                             embed %d or %ld for page #
    Input formats: PostScript PostScriptLevell PostScriptLevel2 PDF Available devices:
      x11 x11alpha x11cmyk x11gray2 x11gray4 x11mono x11rg16x x11rg32x md2k
      md5k md50Mono md50Eco md1xMono bj10e bj10v bj10vh bj200 bjc600 bjc800
      lips2p lips3 lips4 bjc880j lips4v uniprint dmprt epag escpage lp2000
      alc8600 alc8500 alc2000 alc4000 lp8800c lp8300c lp8500c lp3000c lp8200c
      lp8000c epl5900 epl5800 epl2050 epl2050p epl2120 lp7500 lp2400 lp2200
      lp9400 lp8900 lp8700 lp8100 lp7700 lp8600f lp8400f lp8300f lp1900
    lp9600s
      lp9300 lp9600 lp8600 lp1800 mjc180 mjc360 mjc720 mj500c deskjet djet500
    cdeskjet cdjcolor cdjmono cdj550 cdj670 cdj850 cdj880 cdj890 cdj1600
      cdj970 laserjet ljetplus ljet2p ljet3 ljet3d ljet4 ljet4d cljet5
      cljet5c cljet5pr lj5mono lj5gray pj pjxl pjxl300 pxlmono pxlcolor pcl3 hpdj ijs
      npdl rpdl gdi bmpmono bmpgray bmp16 bmp256 bmp16m bmp32b bmpsep1 bmpsep8
      faxg3 faxg32d faxg4 jpeg jpeggray pcxmono pcxgray pcx16 pcx256 pcx24b
      pcxcmyk pdfwrite bit bitrgb bitcmyk pbm pbmraw pgm pgmraw pgnm pgnmraw pnm 
    pnmraw ppm ppmraw pkm pkmraw pksm pksmraw pngmono pnggray png16
      png256 png16m psmono psgray psrgb pswrite epswrite tiffcrle tiffg3
      tiffg32d tiffg4 tiff12nc tiff24nc tifflzw tiffpack nullpage
    Search path:
      .  :  /opt/lib/ghostscript  :  /opt/lib/ghostscript/fonts  :
      /opt/lib/ghostscript/garamond  :  /usr/local/share/ghostscript/7.05/lib  :
      /usr/local/share/ghostscript/fonts
    For more information, see /usr/local/share/ghostscript/7.05/doc/Use.htm.
    Report bugs to bug-gs@ghostscript.com, using the form in Bug-form.htm.
    

    PDF

    PDF, or Portable Document Format, is a newer format for transferring print documents. Like PostScript, it comes from Adobe, and it is becoming increasingly important as a document interchange format on the Internet.

    There are two ways to handle PDF:

  • Use Acrobat Reader, available in the Ports Collection as /usr/src/print/acroread5. The 5 refers to the version of Acrobat Reader and may change. Acrobat Reader is proprietary, but it's available for free, unfortunately only in binary form. It is quite a convenient way to view PDF documents, and it can print them in PostScript formats. This means that you can also use it to convert PDF to PostScript.
  • ghostscript also understands PDF, and it is capable of converting between PostScript and PDF in both directions. ghostscript provides two scripts, pdf2ps and ps2pdf, which act as a front end to ghostscript to make the job easier.
  • Un like PostScript, an editor is available for PDF (Acrobat, the big brother of Acrobat Reader). Unfortunately, it's proprietary and not free, and worse still, it's not available for FreeBSD.

    Вернуться к учебному плану