summaryrefslogtreecommitdiff
path: root/static/v10/man1/postreverse.1
blob: d7c3fd1e6754ebfeab9ac706c28afcac2bebdceb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
.TH POSTREVERSE 1
.SH NAME
.B postreverse
\- reverse the page order in a PostScript file
.SH SYNOPSIS
\*(mBpostreverse\f1
.OP "" options []
.OP "" file []
.SH DESCRIPTION
.B postreverse
reverses the page order in files that conform to Adobe's
Version 1.0 or Version 2.0 PostScript file structuring conventions,
and writes the results on the standard output.
Only one input
.I file
is allowed and if no
.I file
is specified, the standard input is read.
The following
.I options
are understood:
.TP  0.75i
.OP \-o list
Select pages whose numbers are given in the comma-separated
.IR list .
The list contains single numbers
.I N
and ranges
.IR N1\-\|N2 .
A missing
.I N1
means the lowest numbered page, a missing
.I N2
means the highest.
.TP 
.OP \-r
Do not reverse the pages in
.IR file .
.TP 
.OP \-T dir
Use
.I dir
as the temporary file directory when
reading from the standard input.
By default
.I dir
is set to
.MR /tmp .
.PP
.B postreverse
can handle a limited class of files
that violate page independence,
provided all global definitions are bracketed by
.MW %%BeginGlobal
and
.MW %%EndGlobal
comments.
In addition, files that mark the end of each page with
.MW "%%EndPage:\ label\ ordinal"
comments will also reverse properly, provided the prologue and
trailer sections can be located.
If
.B postreverse
fails to find an
.MW %%EndProlog
or
.MW %%EndSetup
comment the entire
.I file
is copied, unmodified, to the standard output.
.PP
Since global definitions are pulled out of individual
pages and put in the prologue, the output file can be
minimally conforming, even if the input
.I file
was not.
.SH EXAMPLES
Select pages 1 to 100 from
.I file
and reverse the pages:
.EX
postreverse -o1-100 \f2file
.EE
Print four logical pages on each physical page
and reverse all the pages:
.EX
postprint -n4 \f2file\fP | postreverse
.EE
Produce a minimally conforming file from output
generated by dpost without reversing the pages:
.EX
dpost \f2file\fP | postreverse -r
.EE
.SH DIAGNOSTICS
A 0 exit status is returned if
.I file
was successfully processed.
.SH BUGS
No attempt has been made to deal with redefinitions of global
variables or procedures.
If standard input is used, the input
.I file
will be read three times before being reversed.
.SH SEE ALSO
.BR dpost (1),
.BR postdaisy(1),
.BR postdmd(1),
.BR postio(1),
.BR postmd(1),
.BR postprint(1),
.BR posttek(1),
.BR psencoding (1)