summaryrefslogtreecommitdiff
blob: e70d4546063bd4d0f7b51664d607670769ecaaa6 (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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
<link rel="shortcut icon" type="image/png" href="../../images/favicon.png">
<title>Ghostscript: Sample CMYK 32-bit Device that Supports Post Rendering Processing</title>
<link href="style.css" rel="stylesheet" type="text/css">
<link href="gs-style.css" rel="stylesheet" type="text/css">
</head>

<body>

    <div class="header">
    <div class="row">
        <div class="col-lt-6 logo"><a href="https://www.ghostscript.com/"><img src="images/ghostscript_logo.png" width="108" height="119" alt=""></a></div>
        <div class="col-6"><div class="row"><div class="artifexlogo"><a href="https://artifex.com" target="_blank"><img src="images/Artifex_logo.png" width="194" height="40" alt=""></a></div>
        <div class="col-12"><div class="button button1"><a href="https://artifex.com/contact-us/" title="Contact Us" target="_blank">Contact Us</a></div>
        <div class="button button2 hidden-xs"><a href="https://www.ghostscript.com/download.html" title="Download">Download</a></div></div></div>
    </div>
    </div>
    </div>

    <div class="banner">
    <div class="row">
        <div class="col-12"> Using Saved Pages ( --saved-pages=... )</div>
    </div>
    </div>

    <div class="main">
    <div class="row">
    <div id="sidebar">
    <div class="sidebar-item"></div>
    <div class="col-2 leftnav">
<ul>
            <li><a href="https://www.ghostscript.com/">Home</a></li>
            <li><a href="https://www.ghostscript.com/license.html">Licensing</a></li>
            <li><a href="https://www.ghostscript.com/releases.html">Releases</a></li>
            <li><a href="https://www.ghostscript.com/release_history.html">Release History</a></li>
            <li><a href="https://www.ghostscript.com/documentation.html" title="Documentation">Documentation</a></li>
            <li><a href="https://www.ghostscript.com/download.html" title="Download">Download</a></li>
            <li><a href="https://www.ghostscript.com/performance.html" title="Performance">Performance</a></li>
            <li><a href="http://jbig2dec.com/" title="jbig2dec">jbig2dec</a></li>
            <li><a href="http://git.ghostscript.com/?p=ghostpdl.git;a=summary">Source</a></li>
            <li><a href="http://bugs.ghostscript.com/">Bugs</a></li>
            <li><a href="https://www.ghostscript.com/faq.html" title="FAQ">FAQ</a></li>
        </ul>
    </div>
    </div>
    <div class="col-10 page">

<!--START EDITING HERE-->

<h2>Table of contents</h2>

<ul>
<li><a href="#Keywords">Saved Pages control keywords,</a>
<li><a href="#Print_Keywords">Printing saved pages.</a>
<li><a href="#Examples">Examples.</a>
</ul>

<!-- [1.2 end table of contents] =========================================== -->

<!-- [1.3 begin hint] ====================================================== -->
<p>
Saved pages can be printed in any order, any number of times allowing for copy
collation, manual 'duplex' printing or selecting a subset of pages.
</p>

<!-- [1.3 end hint] ======================================================== -->

<!-- [1.0 end visible header] ============================================== -->

<!-- [2.0 begin contents] ================================================== -->

<p>
Many raster printing devices and raster image format devices can use the command
list (clist) to save the rendering information into files or memory based structures.
Usually the clist data is rendered as soon as the page is complete, but it is`
possible to defer rendering, then output (print) after the entire file has been
converted to clist files.
<p>
Since each page is saved separately, the pages can be rendered from the clist
files in any order, any number of times.
<p>
The saved pages are accumulated in clist form as files or in memory. The default
clist storage is specified by the <code>BAND_LIST_STORAGE=</code> macro in the
make file, but if <code>BAND_LIST_STORAGE=file</code>, the clist can be forced
to be in memory using the <code>-sBandListStorage=memory</code> option.
<hr>
<h2><a name="Keywords"></a>Saved Pages control keywords</h2>
<p>
Deferring printing is controlled using the <code>--saved-page=...</code> option.
<p>
The string following the <code>--saved-page=</code> consists of keywords,
separated by white-space, commas, or other non-alphanumeric characters
such as ':', '=', ';'. If more than one keyword is given, the string should
be enclosed in double-quotes (<code>"</code>).
<p>
The '<code>-</code>' (dash), and the '<code>*</code>' asterisk), are used in
page range selections, and cannot be keyword separators.
<p>
Keywords are case independent, thus "<b><code>begin</code></b>",
"<b><code>BEGIN</code></b>", and "<b><code>Begin</code></b>" are all equivalent.
<p>
<dl>
<dt><code>begin</code>
<dd>Begins accumulating pages to a list. The clist data for each page is
saved in files or memory as discussed above, but no rendering is performed.
<p>
If the device was set for rendering into memory, is will be switched to
accumulating the page as clist files, thus <code>-dMaxBitmap</code> and
<code>-dBandingNever</code> will be ignored, as if <code>-dBandingAlways</code>
was specified.
</dl>

<dl>
<dt><code>flush</code>
<dd>Delete all clist files for all pages on the list, and reset the
list to empty, but remain in <code>saved-pages</code> mode. Subsequent
pages will be added to the list.
</dl>

 <dl>
<dt><code>end</code>
<dd>Flush any list, deleting all clist files for any accumulated pages
and stop accumulating pages, returning to rendering/output as soon as
the page is complete.
<p>
The device may render subsequent pages in memory (page buffer) as
determined by </code>-dMaxBitmap</code> and </code>-dBandingNever</code>.
</dl>

<dl>
<dt><code>copies </code><em>copy_count</em>
<dd>Set the copy count for the <code>print</code> action. The requested number
of copies will be generated for all subsequent print actions, thus
producing <b>collated</b> copies, rather than multiple copies of
each page as in normal (non-deferred) rendering and output.
<p>
A <code>--saved-pages="copies <em>#</em>"</code> option will be applied to all
print actions until a new <code>copies <em>#</em></code> is encountered
that sets the copy count to a different value. Since the
<code>copies</code> can follow the <code>print</code> command, it is
recommended that only a single <code>copies</code> be in a each
<code>--saved-pages=</code><em>...</em> string.
<p>
Note, that unless <code>-d.IgnoreNumCopies=true</code> is specified
prior to starting <code>saved-pages</code> mode, the copy count for
each page will be saved with each page, and the job will contain the
specified number of copies of each page, as well as producing the
number of collated copies of the job set by the <code>copies</code>
in a <code>--saved-pages=</code><em>...</em> string.
</dl>

<dl>
<dt><code>print </code><em>print keywords</em>
<dd>Print from the list of saved pages. The <em>print keywords</em>
follwing the <code>print</code> action keyword determine what is
printed, and in what order. The keywords are described in the next
section.
</dl>


<h3><a name="Print_Keywords"></a>Printing Saved Pages</h3>

<p>
The string following the <code>print</code> action keyword determines which pages
from the list are printed, in what order. Any sequence of keywords, page numbers
or page ranges can follow the <code>print</code> keyword. The first control keyword
(other than <code>copies</code>) ends the list of printing keywords.
<p>
As with control keywords, print keywords can be any mixture of upper or lower case,
and print keyword, page numbers and page ranges can be seperated by any non-alphanumeric
character other than '<code>-</code>' or '<code>*</code>'.
<p>
The following are all equivalent:
<blockquote><dl>
<dt><code>1 3 5 - *</code>
<dt><code>1, 3, 5-*</code>
<dt><code>1,3,5-*</code>
</dl></blockquote>

<dl>
<dt><code>copies </code><em>copy_count</em>
<dd>As mentioned above, the <code>copies</code> keyword and count can follow the <code>print</code>
keyword. See the description of the <code>copies</code> keyword in the previous section.
<p>
The copy count will be applied to the entire sequence of print keywords, so it can
appear anywhere in the sequence of page number, page ranges or print keywords.
</dl>

<dl>
<dt><code>normal</code>
<dd>Print all of the pages, from the first until the last page in the list. This
keyword is used to print collated copies in the usual page order. This is the
same as the page range: <code>"1 - *"</code>
</dl>

<dl>
<dt><code>reverse</code>
<dd>Print all of the pages, from the last backwards to the first page in the list. This
keyword is used to print collated copies in the reverse page order. This is the
same as the page range: <code>"* - 1"</code>
</dl>

<dl>
<dt><code>odd</code>
<dd>Print all odd number pages, from 1 to the last odd numbered page. This keyword,
combined with the <code>even</code> keyword and user interaction to place pages that
were printed into the input tray, can be used for manual duplexing.
</dl>

<dl>
<dt><code>even</code>
<dd>Print all even number pages, from 2 to the last even numbered page, then if the
list has an odd number of pages print a blank 'pad' page to be the back of the last odd
page. This keyword, combined with the <code>odd</code> keyword and user interaction to
place pages that were printed into the input tray, can be used for manual duplexing.
</dl>

<dl>
<dt><code>even0pad</code>
<dd>Print all even number pages, from 2 to the last even numbered page, without any
blank 'pad' page as with the <code>even</code> keyword.
</dl>

 <dl>
<dt><em>page_number</em>
<dd>A number not followed by '<code>-</code>' specifies a single page from the
list to be printed. <b> The '<code>*</code>' character represents the last page in
the list, interpreted as a number, either as a single <em>page_number</em> or as the
<em>start_page</em> or <em>end_page</em> in a page range.
</b>
</dl>

 <dl>
<dt><em>start_page</em> <code>-</code> <em>end_page</em>
<dd>A range of pages is two <em>page_number</em>s or <code>*</code> separated by a
'<code>-</code>', optionally surrounded by non-alphanumeric characters other than
'<code>-</code>' which is a special character in page range specifications. The
pages from the <em>start_page</em> to the <em>end_page</em> are printed.
<p>
If the <em>start_page</em> is after the <em>end_page</em>, then the order of the
pages is reversed, from the <em>start_page</em> back to the <em>end_page</em>.
</dl>

<hr>
<h2><a name="Examples"></a>Examples</h2>
The following examples each print 2 collated copies from the first page to the last page:
<blockquote><dl><code>
<dt>--saved-pages="print: normal, copies=2"
<dt>--saved-pages="print copies=2, normal"
<dt>--saved-pages="copies 2 print normal"
<dt>--saved-pages="print 1-* 1-*"
<dt>--saved-pages="print normal normal"
</code></dl></blockquote>

Print the last page,  followed by all pages in reverse order, then the first page
(print reverse with two copies of the last and first page):
<blockquote><dl><code>
<dt>--saved-pages="print * reverse 1"
<dt> -or-
<dt>--saved-pages="print * * - 1 1"
</code></dl></blockquote>

Using the command line arguments with a PostScript or PDF input file to print
the odd pages, prompt the operator to reload the printer with the pages that
were printed, then print the even pages:

<blockquote><dl><code>
<dt>gs -sDEVICE=pgmraw -o /dev/lp0 --saved-pages="begin" examples/annots.pdf \
<dt>--saved-pages="print odd" \
<dt>-c "(Move printed pages to the input tray, then press enter.) = flush \
<dt> (%stdin) (r) file 256 string readline clear" \
<dt>--saved-pages="print even"
</code></dl></blockquote>

Print two collated copies of the first file, followed by 5 copies of the second file:
<blockquote><dl><code>
<dt>gs -sDEVICE=pgmraw -o /dev/lp0 --saved-pages="begin" examples/annots.pdf \
<dt>--saved-pages="copies=2 print normal flush" \
<dt>examples/colorcir.ps \
<dt>--saved-pages="copies=5 print normal"
</code></dl></blockquote>

<!-- [2.0 end contents] ==================================================== -->

<!-- [3.0 begin visible trailer] =========================================== -->
<hr>

<p>
<small>Copyright &copy; 2013-2019 Artifex Software, Inc.  All rights
reserved.</small>

<p>
This software is provided AS-IS with no warranty, either express or
implied.

This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.

For more information about licensing, please visit
http://www.artifex.com/licensing/
or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
Novato, CA 94945, U.S.A., +1(415)492-9861.

<p>
<small>Ghostscript version 9.53.0, 10 September 2020

<!-- [3.0 end visible trailer] ============================================= -->

<!--FINISH EDITING HERE-->

    </div>
    </div>
    </div>

    <div class="footer">
    <div class="row">
        <div class="col-7 footleft">
        <ul>
            <li><a href="https://artifex.com/contact-us/" target="blank">CONTACT US</a></li>
            <li><a href="https://artifex.com/about-us/" target="blank">ABOUT</a></li>
            <li><a href="https://ghostscript.com/security.html">SECURITY</a></li>
        </ul>
        </div>
        <div class="col-1 footcenter">
         <ul>
           <li><a href="https://artifex.com/support/" target="blank">SUPPORT</a></li>
           <li><a href="https://artifex.com/blog/artifex/" target="blank">BLOG</a></li>
           <li><a href="https://artifex.com/privacy-policy/" target="blank">PRIVACY</a></li>
           </ul>
        </div>
        <div class="col-ft-3 footright"><img src="images/Artifex_logo.png" width="194" height="40" alt=""/> <br>
              © Copyright 2019 Artifex Software, Inc. <br>
            All rights reserved.
        </div>
          </div>
    </div>

    <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
    <script src="index.js"></script>
</body>
</html>