AIX Printer Tips: Printing Text 2-Up and Landscape in AIX


Contents

About This Document
Example of What Is Meant by 2-Up
Text to a PostScript Queue with enscript
Text to a Text Queue with the pr Filter
PostScript to a PostScript Queue with psnup
Setting Up a 2-Up Queue with a Filter

About This Document

This document describes how to create an AIX queue to print 2-up. The 2-up queue places two pages of print information on a single sheet of paper. The paper is rotated to landscape so that both pages appear side by side. Examples are provided for handling both text and PostScript files.

This document applies to all levels of AIX.


Example of What Is Meant by 2-Up

The output will be rotated, small and look something like this:

  +--------------------------------------------------------+
  | page one on this side          Page two on this side   +
  | page one on this side          Page two on this side   +
  | page one on this side          Page two on this side   +
  | page one on this side          Page two on this side   +
  | page one on this side          Page two on this side   +
  | page one on this side          Page two on this side   +
  | page one on this side          Page two on this side   +
  | page one on this side          Page two on this side   +
  | page one on this side          Page two on this side   +
  | page one on this side          Page two on this side   +
  | page one on this side          Page two on this side   +
  | page one on this side          Page two on this side   +
  +--------------------------------------------------------+


Text to a PostScript Queue with enscript

Perhaps the easiest way to get a nice-looking 2-up output for ASCII text is by printing with enscript to a PostScript queue as shown in this example. The -2 indicates 2-up, the r is for rotate, and the G is for Gaudy which adds some page numbers and other trim.

Text to a Text Queue with the pr Filter

Another way to easily generate 2-up output is to use the pr filter that comes with AIX. The following is a sample command that will generate 2-up text output for a PCL laser printer queue.  The -l 60 specifies the length per page,  the -w 172 specifies the width, and the -2 tells pr to format the file 2-up.  The qprt -z+ flag is used to make the printer print landscape.  We use the passthrough flag because pr will add carriage returns to the line feeds already.

PostScript to a PostScript Queue with psnup

With PostScript files, the options are more limited.  Many applications give the ability to create 2-up output.  An example of a program that will let you do this is Freelance Graphics in Windows.  Sometimes you have a PostScript file that is already created and you want to print that 2-up.  The psnup utility was designed just for this purpose.  This utility is not shipped with AIX, but is available from a number of UNIX shareware sites as well as included in the CD-ROM from the O'Reilly book, "UNIX Power Tools".  From IBM puborder, this is SR28-4965.   The command syntax may vary based on the application generating the output.  The following is an example command:

Setting Up a 2-Up Queue with a Filter

The following example shows how to set up the pr filter in an AIX virtual printer to create a 2-up text queue.  Similar changes could be made to add an enscript 2-up queue.
  1. Create any ASCII text queue called txt2up
  2. Type: lsvirprt
  3. Select the txt2up queue
  4. Type: z=+ to rotate the output
  5. Type: p=17 to put printer in pitch 17
  6. Type: f=p to have queue use pr filter
  7. Type: fp~v To enter vi edit session of fp attribute
  8. Change the screen to show this:
  9. 'pr' filter
    fp = -l 60 -w 172 -2  %F[h] %I@1
    
     ' -l 60 -w 172 -2  '
     %F[h]         If "-h] Argument" on Command Line, "-# Argument" -> OUTPUT
     ' '
     %I@1          INCLUDE: (Path Name of File Being Printed)
    ~
  10. Type: fp, which should show:
  11. Name    Description                         Value
    fp      'pr' filter                     pr -l 60 -w 172 -2
                                            %F[h] %I@1


Printing Text 2-Up and Landscape in AIX: AIX Printer Tips: 2up.html ITEM: FAX
Dated: 99/02/15~00:00 Category: zap
This HTML file was generated 99/06/24~12:42:12
Comments or suggestions? Contact us