1.107.3 Print files Weight 1

Linux Professional Institute Certification — 102

               Geoff Robertson <ge@ffrey.com>
              Nick Urbanik <nicku@nicku.org>

2005 July

Description of Objective

Candidates should be able to manage print queues and manipulate print jobs. This objective includes adding and removing jobs from configured printer queues and converting text files to postscript for printing.

Key files, terms, and utilities include:

lpr
lpq
mpage

– General Linux 2 – Print Files [2mm] (Linux

Professional Institute Certification)[1mm]

1

1Copyright \begin{matrix}c \\ ◯ \end{matrix} 2002 Geoffrey Robertson. Permission is granted to make and distribute verbatim copies or modified versions of this document provided that this copyright notice and this permission notice are preserved on all copies under the terms of the GNU General Public License as published by the Free Software Foundation—either version 2 of the License or (at your option) any later version.

\underline{2}

   .~.          Original presentation by Andrew Eager
   /V\          geoffrey robertson
  // \\         geoffrey@zip.com.au
  @._.@
$Id: gl2.107.3.slides.tex,v 1.4 2003/12/01 12:15:21 waratah Exp $ %$

Print files

1.107.2 Manage printers & print queues

1.107.3 \underline{Print files}

1.107.4 Install & configure local & remote printers

Print Files

Candidates should be able to manage print queues and manipulate print jobs. This objective includes adding and removing jobs from configured printer queues and converting text files to postscript for printing.

Print Files

lpq Display Print queue

lpr Job submission

mpage Print multiple pages per sheet

Printing-HOWTO

Printing-Usage-HOWTO

LPR - Submit job to Print Queue

• lpr is used to submit a job to the print queue

• lpr can be run from the command line

• lpr assumes text is to be printed by default

• lpr uses /etc/printcap for printer settings

Usage of lpr is:

   lpr [-Pprinter] [-#num] filename ...

Example:- Print /etc/hosts file to spool lp0

   $ lpr -Plp0 /etc/hosts ↩

a2ps - Convert ASCII to Postscript

• Most Unix sites use postscript printers

• You can not send an ASCII file directly to a postscript printer

• To convert from ASCII to ps, use a2ps

Usage: a2ps [-o out-file] in-file

Example:

$ a2ps -o myfile.ps myfile.txt ↩
$ cat myfile.ps > /dev/lp0 ↩

mpage - Print multiple pages per page

• mpage will print multiple pages per physical page

• Input can be either text or postscript

• 1, 2, 4 or 8 pages can be printed per page

• Output can be directed to printer or stdout

Usage:

mpage [-1248] [options] input-file ...

Example: Print 4 pages per page on A4

$ mpage -4 -b A4 bigfile.ps | lpr ↩

License Of This Document Copyright (C) 2005 Nick Urbanik <nicku@nicku.org> You can redistribute modified or unmodified copies of this document provided that this

copyright notice and this permission notice are preserved on all copies under the terms of the GNU General Public License as published by the Free Software Foundation–either version 2 of the License or (at your option) any later version.