| 1 |
.TH PSTOPS 1 "PSUtils" |
| 2 |
.SH NAME |
| 3 |
pstops \- shuffle pages in a PostScript file |
| 4 |
.SH SYNOPSIS |
| 5 |
.B pstops |
| 6 |
.RB [ \-q ] |
| 7 |
.RB [ \-b ] |
| 8 |
.RB [ \-w\fIwidth\fR ] |
| 9 |
.RB [ \-h\fIheight\fR ] |
| 10 |
.RB [ \-p\fIpaper\fR ] |
| 11 |
.RB [ \-d [ \fIlwidth\fR ]] |
| 12 |
.I pagespecs |
| 13 |
.RI [ infile |
| 14 |
.RI [ outfile ]] |
| 15 |
.SH DESCRIPTION |
| 16 |
.I Pstops |
| 17 |
rearranges pages from a PostScript document, creating a new PostScript file. |
| 18 |
The input PostScript file should follow the Adobe Document Structuring |
| 19 |
Conventions. |
| 20 |
.I Pstops |
| 21 |
can be used to perform a large number of arbitrary re-arrangements of |
| 22 |
Documents, including arranging for printing 2-up, 4-up, booklets, reversing, |
| 23 |
selecting front or back sides of documents, scaling, etc. |
| 24 |
.PP |
| 25 |
.I pagespecs |
| 26 |
follow the syntax: |
| 27 |
.RS |
| 28 |
.TP 12 |
| 29 |
.I pagespecs |
| 30 |
= |
| 31 |
.RI [ modulo\fB:\fP ] specs |
| 32 |
.TP |
| 33 |
.I specs |
| 34 |
= |
| 35 |
.IR spec [ \fB+\fPspecs | \fB,\fPspecs ] |
| 36 |
.TP |
| 37 |
.I spec |
| 38 |
= |
| 39 |
.RB [ - ] \fIpageno\fP [ L | R | U ][ H | V ][ @\fIscale\fP ][ ( \fIxoff\fP , \fIyoff\fP ) ] |
| 40 |
.RE |
| 41 |
.sp |
| 42 |
.I modulo |
| 43 |
is the number of pages in each block. The value of |
| 44 |
.I modulo |
| 45 |
should be greater than 0; the default value is 1. |
| 46 |
.I specs |
| 47 |
are the page specifications for the pages in each block. The value of the |
| 48 |
.I pageno |
| 49 |
in each |
| 50 |
.I spec |
| 51 |
should be between 0 (for the first page in the block) and \fImodulo\fR-1 |
| 52 |
(for the last page in each block) inclusive. |
| 53 |
The optional dimensions |
| 54 |
.I xoff |
| 55 |
and |
| 56 |
.I yoff |
| 57 |
shift the page by the specified amount. |
| 58 |
.I xoff |
| 59 |
and |
| 60 |
.I yoff |
| 61 |
are in PostScript's points, but may be followed by the units |
| 62 |
.B "cm" |
| 63 |
or |
| 64 |
.B "in" |
| 65 |
to convert to centimetres or inches, or the flag |
| 66 |
.B "w" |
| 67 |
or |
| 68 |
.B "h" |
| 69 |
to specify as a multiple of the width or height. |
| 70 |
The optional parameters |
| 71 |
.BR L , |
| 72 |
.BR R , |
| 73 |
.BR R , |
| 74 |
.BR R , |
| 75 |
and |
| 76 |
.B V |
| 77 |
rotate the page left, right, or upside-down, and flip (mirror) page |
| 78 |
horizontally or vertically. |
| 79 |
The optional |
| 80 |
.I scale |
| 81 |
parameter scales the page by the fraction specified. |
| 82 |
If the optional minus sign is specified, the page is relative to the end of |
| 83 |
the document, instead of the start. |
| 84 |
|
| 85 |
If page |
| 86 |
.IR spec s |
| 87 |
are separated by |
| 88 |
.B + |
| 89 |
the pages will be merged into one page; if they are separated by |
| 90 |
.B , |
| 91 |
they will be on separate pages. |
| 92 |
If there is only one page specification, with |
| 93 |
.I pageno |
| 94 |
zero, the \fIpageno\fR may be omitted. |
| 95 |
|
| 96 |
The shift, rotation, and scaling are applied |
| 97 |
to the PostScript transformation matrix |
| 98 |
in that order regardless of which order |
| 99 |
they appear on the command line. |
| 100 |
The matrix accumulates the individual transformations. |
| 101 |
The effect on the image is to first scale with respect to an origin |
| 102 |
at the lower left corner, then rotate about the same origin, and |
| 103 |
finally shift. |
| 104 |
.PP |
| 105 |
The |
| 106 |
.B \-w |
| 107 |
option gives the width which is used by the |
| 108 |
.B "w" |
| 109 |
dimension specifier, and the |
| 110 |
.B \-h |
| 111 |
option gives the height which is used by the |
| 112 |
.B "h" |
| 113 |
dimension specifier. These dimensions are also used (after scaling) to set the |
| 114 |
clipping path for each page. |
| 115 |
The |
| 116 |
.B \-p |
| 117 |
option can be used as an alternative, to set the paper size. See |
| 118 |
.BR paper (1). |
| 119 |
.PP |
| 120 |
The |
| 121 |
.B \-b |
| 122 |
option prevents any |
| 123 |
.B bind |
| 124 |
operators in the PostScript prolog from binding. This may be needed in cases |
| 125 |
where complex multi-page re-arrangements are being done. |
| 126 |
.PP |
| 127 |
The |
| 128 |
.D \-d |
| 129 |
option draws a line around the border of each page, of the specified width. |
| 130 |
If the \fIlwidth\fR parameter is omitted, a default linewidth of 1 point is |
| 131 |
assumed. The linewidth is relative to the original page dimensions, |
| 132 |
i.e., it is scaled up or down with the rest of the page. |
| 133 |
.PP |
| 134 |
Pstops normally prints the page numbers of the pages re-arranged; the |
| 135 |
.B \-q |
| 136 |
option suppresses this. |
| 137 |
.SH EXAMPLES |
| 138 |
This section contains some sample re-arrangements. To put two pages on one |
| 139 |
sheet (of A4 paper), the pagespec to use is: |
| 140 |
.sp |
| 141 |
.ce |
| 142 |
"2:[email protected](21cm,0)[email protected](21cm,14.85cm)" |
| 143 |
.sp |
| 144 |
To select all of the odd pages in reverse order, use: |
| 145 |
.sp |
| 146 |
.ce |
| 147 |
2:-0 |
| 148 |
.sp |
| 149 |
To re-arrange pages for printing 2-up booklets, use |
| 150 |
.sp |
| 151 |
.ce |
| 152 |
"4:[email protected](21cm,0)[email protected](21cm,14.85cm)" |
| 153 |
.sp |
| 154 |
for the front sides, and |
| 155 |
.sp |
| 156 |
.ce |
| 157 |
"4:[email protected](21cm,0)[email protected](21cm,14.85cm)" |
| 158 |
.sp |
| 159 |
for the reverse sides (or join them with a comma for duplex printing). |
| 160 |
.SH AUTHOR |
| 161 |
Written by Angus J. C. Duggan. |
| 162 |
.SH "SEE ALSO" |
| 163 |
.BR psutils (1) |
| 164 |
.SH TRADEMARKS |
| 165 |
.B PostScript |
| 166 |
is a trademark of Adobe Systems Incorporated. |
| 167 |
.SH BUGS |
| 168 |
.B Pstops |
| 169 |
does not accept all DSC comments. |