Specify Paper Size for PostScript Output

You can specify a Ghostscript-supported page size from the Ghostscript command line or define paper sizes in a device translation table.

The Uniface default paper size is A4, but Ghostscript's default paper size is U.S Letter. Both the Ghostscript command line and the Uniface paper size must be in agreement with each other to produce consistent output.

To add a new paper size:

  1. Create a new printer device translation table or modify an existing one.

    For example, the device translation table P_X11 in library USYS defines the following modes:

    A4 mode_0(0,100)
    A4 mode_1(0,100)[2,1]
    A4 mode_2(0,50)
    A4 mode_3(0,50)[2,1]
    Letter mode_4(0,100)
    Letter mode_5(0,100)[2,1]
    Letter mode_6(0,50)
    Letter mode_7(0,50)[2,1]

    There is no A2 paper size defined, so to print to paper size A2, copy P_X11 under another name, such as P_X11A2, and modify the modes (in the BEGIN_DEVICE section) with the desired paper name, for example, for A2:

    BEGIN_DEVICE
    ^000			cursor(0,0)	cursor posit command
    A2			mode_0(0,200)
    A2			mode_1(0,200)[2,1]
    A2			mode_2(0,100)
    A2			mode_3(0,100)[2,1]
  2. On Unix, you can add the new paper size to the [papers] section of psdef.txt. The syntax is:

    PaperName: WidthHeight (in millimeters)

    For example:

    [papers] 
    A5: 148.5 210.0 
    A4: 210.0 297.0 
    A3: 297.0 420.0 
    A2: 420.0 594.0 
    Letter: 215.9 279.4 
    Legal: 215.9 355.6 
  3. Otherwise, specify a page size in the Ghostscript command line:
    • Use the -sPAPERSIZE=PaperSIze switch.

      If the desired paper size is listed in the table of paper sizes supported by Ghostscript (below), you can select it as the default paper size for a single invocation of Ghostscript by using the -sPAPERSIZE switch, for example, -sPAPERSIZE=a4 or -sPAPERSIZE=legal.

    • Use the -dDEVICEWIDTHPOINTS=w and -dDEVICEHEIGHTPOINTS=h switches, where w is the desired paper width in points (1/72-inch units) and h is the desired paper height in points.

    For example, for the new A2 paper size, use -sPAPERSIZE=a2.

Uniface supports most standard US and ISO paper sizes for PostScript printing. The paper sizes known to Ghostscript are defined at the beginning of the initialization file gs_statd.ps; see the comments there for more details about the definitions. The paper sizes are defined exactly in points. The following table lists the paper sizes by name and size. The dimensions in inches (at 72 points per inch) and centimeters are derived from the point sizes, rounded to the nearest 0.1 unit.

Paper Sizes Supported by GhostScript
Name Inches

w and h

cm

w and h

Points

w and h

U.S. Standard
11 x 17

(portrait)

11.0 17.0 27.9 43.2 792 1224
ledger

(11x17 landscape)

17.0 11.0 43.2 27.9 1224 792
legal 8.5 14.0 21.6 35.6 612 1008
letter 8.5 11.0 21.6 27.9 612 792
lettersmall 8.5 11.0 21.6 27.9 612 792
archE 36.0 48.0 91.4 121.9 2592 3456
archD 24.0 36.0 61.0 91.4 1728 2592
archC 18.0 24.0 45.7 61.0 1296 1728
archB 12.0 18.0 30.5 45.7 864 1296
archA 9.0 12.0 22.9 30.5 648 864
ISO Standard
a0 33.1 46.8 84.0 118.8 2380 3368
a1 23.4 33.1 59.4 84.0 1684 2380
a2 16.5 23.4 42.0 59.4 1190 1684
a3 11.7 16.5 29.7 42.0 842 1190
a4 8.3 11.7 21.0 29.7 595 842
a4small 8.3 11.7 21.0 29.7 595 842
a5 5.8 8.3 14.9 21.0 421 595
a6 4.1 5.8 10.5 14.9 297 421
a7 2.9 4.1 7.4 10.5 210 297
a8 2.1 2.9 5.2 7.4 148 210
a9 1.5 2.1 3.7 5.2 105 148
a10 1.0 1.5 2.6 3.7 74 105
isob0 39.4 55.7 100.0 141.4 2836 4008
isob1 27.8 39.4 70.7 100.0 2004 2836
isob2 19.7 27.8 50.0 70.7 1418 2004
isob3 13.9 19.7 35.3 50.0 1002 1418
isob4 9.8 13.9 25.0 35.3 709 1002
isob5 7.0 9.8 17.7 25.0 501 709
c0 36.1 51.1 91.7 129.7 2600 3677
c1 25.5 36.1 64.8 91.7 1837 2600
c2 18.0 25.5 45.8 64.8 1298 1837
c3 12.8 18.0 32.4 45.8 918 1298
c4 9.0 12.8 22.9 32.4 649 918
c5 6.4 9.0 16.2 22.9 459 649
c6 4.5 6.4 11.4 16.2 323 459

Related Topics