File: qprinter.html

package info (click to toggle)
python-qt4 4.0.1-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 18,632 kB
  • ctags: 2,639
  • sloc: python: 29,409; sh: 5,646; cpp: 3,168; xml: 149; makefile: 109
file content (555 lines) | stat: -rw-r--r-- 46,921 bytes parent folder | download
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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QPrinter Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QPrinter Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QPrinter class is a paint device that paints on a printer. <a href="#details">More...</a></p>
<p>Inherits <a href="qpaintdevice.html">QPaintDevice</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qprinter.html#ColorMode-enum">ColorMode</a></b> { GrayScale, Color }</li><li><div class="fn" />enum <b><a href="qprinter.html#Orientation-enum">Orientation</a></b> { Portrait, Landscape }</li><li><div class="fn" />enum <b><a href="qprinter.html#OutputFormat-enum">OutputFormat</a></b> { NativeFormat, PdfFormat }</li><li><div class="fn" />enum <b><a href="qprinter.html#PageOrder-enum">PageOrder</a></b> { FirstPageFirst, LastPageFirst }</li><li><div class="fn" />enum <b><a href="qprinter.html#PageSize-enum">PageSize</a></b> { A4, B5, Letter, Legal, ..., NPageSize }</li><li><div class="fn" />enum <b><a href="qprinter.html#PaperSource-enum">PaperSource</a></b> { OnlyOne, Lower, Middle, Manual, ..., FormSource }</li><li><div class="fn" />enum <b><a href="qprinter.html#PrinterMode-enum">PrinterMode</a></b> { ScreenResolution, PrinterResolution, HighResolution }</li><li><div class="fn" />enum <b><a href="qprinter.html#PrinterState-enum">PrinterState</a></b> { Idle, Active, Aborted, Error }</li><li><div class="fn" />enum <b><a href="qprinter.html#PrintRange-enum">PrintRange</a></b> { AllPages, Selection, PageRange }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qprinter.html#QPrinter">__init__</a></b> (<i>self</i>, PrinterMode&#160;<i>mode</i>&#160;=&#160;QPrinter.ScreenResolution)</li><li><div class="fn" />bool <b><a href="qprinter.html#abort">abort</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qprinter.html#collateCopies">collateCopies</a></b> (<i>self</i>)</li><li><div class="fn" />ColorMode <b><a href="qprinter.html#colorMode">colorMode</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qprinter.html#creator">creator</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qprinter.html#devType">devType</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qprinter.html#docName">docName</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qprinter.html#fontEmbeddingEnabled">fontEmbeddingEnabled</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qprinter.html#fromPage">fromPage</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qprinter.html#fullPage">fullPage</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qprinter.html#metric">metric</a></b> (<i>self</i>, QPaintDevice.PaintDeviceMetric)</li><li><div class="fn" />bool <b><a href="qprinter.html#newPage">newPage</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qprinter.html#numCopies">numCopies</a></b> (<i>self</i>)</li><li><div class="fn" />Orientation <b><a href="qprinter.html#orientation">orientation</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qprinter.html#outputFileName">outputFileName</a></b> (<i>self</i>)</li><li><div class="fn" />OutputFormat <b><a href="qprinter.html#outputFormat">outputFormat</a></b> (<i>self</i>)</li><li><div class="fn" />PageOrder <b><a href="qprinter.html#pageOrder">pageOrder</a></b> (<i>self</i>)</li><li><div class="fn" />QRect <b><a href="qprinter.html#pageRect">pageRect</a></b> (<i>self</i>)</li><li><div class="fn" />PageSize <b><a href="qprinter.html#pageSize">pageSize</a></b> (<i>self</i>)</li><li><div class="fn" />QPaintEngine <b><a href="qprinter.html#paintEngine">paintEngine</a></b> (<i>self</i>)</li><li><div class="fn" />QRect <b><a href="qprinter.html#paperRect">paperRect</a></b> (<i>self</i>)</li><li><div class="fn" />PaperSource <b><a href="qprinter.html#paperSource">paperSource</a></b> (<i>self</i>)</li><li><div class="fn" />QPrintEngine <b><a href="qprinter.html#printEngine">printEngine</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qprinter.html#printerName">printerName</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qprinter.html#printerSelectionOption">printerSelectionOption</a></b> (<i>self</i>)</li><li><div class="fn" />PrinterState <b><a href="qprinter.html#printerState">printerState</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qprinter.html#printProgram">printProgram</a></b> (<i>self</i>)</li><li><div class="fn" />PrintRange <b><a href="qprinter.html#printRange">printRange</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qprinter.html#resolution">resolution</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qprinter.html#setCollateCopies">setCollateCopies</a></b> (<i>self</i>, bool&#160;<i>collate</i>)</li><li><div class="fn" /><b><a href="qprinter.html#setColorMode">setColorMode</a></b> (<i>self</i>, ColorMode)</li><li><div class="fn" /><b><a href="qprinter.html#setCreator">setCreator</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qprinter.html#setDocName">setDocName</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qprinter.html#setEngines">setEngines</a></b> (<i>self</i>, QPrintEngine&#160;<i>printEngine</i>, QPaintEngine&#160;<i>paintEngine</i>)</li><li><div class="fn" /><b><a href="qprinter.html#setFontEmbeddingEnabled">setFontEmbeddingEnabled</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qprinter.html#setFromTo">setFromTo</a></b> (<i>self</i>, int&#160;<i>fromPage</i>, int&#160;<i>toPage</i>)</li><li><div class="fn" /><b><a href="qprinter.html#setFullPage">setFullPage</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qprinter.html#setNumCopies">setNumCopies</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qprinter.html#setOrientation">setOrientation</a></b> (<i>self</i>, Orientation)</li><li><div class="fn" /><b><a href="qprinter.html#setOutputFileName">setOutputFileName</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qprinter.html#setOutputFormat">setOutputFormat</a></b> (<i>self</i>, OutputFormat&#160;<i>format</i>)</li><li><div class="fn" /><b><a href="qprinter.html#setPageOrder">setPageOrder</a></b> (<i>self</i>, PageOrder)</li><li><div class="fn" /><b><a href="qprinter.html#setPageSize">setPageSize</a></b> (<i>self</i>, PageSize)</li><li><div class="fn" /><b><a href="qprinter.html#setPaperSource">setPaperSource</a></b> (<i>self</i>, PaperSource)</li><li><div class="fn" /><b><a href="qprinter.html#setPrinterName">setPrinterName</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qprinter.html#setPrinterSelectionOption">setPrinterSelectionOption</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qprinter.html#setPrintProgram">setPrintProgram</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qprinter.html#setPrintRange">setPrintRange</a></b> (<i>self</i>, PrintRange&#160;<i>range</i>)</li><li><div class="fn" /><b><a href="qprinter.html#setResolution">setResolution</a></b> (<i>self</i>, int)</li><li><div class="fn" />int-list <b><a href="qprinter.html#supportedResolutions">supportedResolutions</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qprinter.html#toPage">toPage</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QPrinter class is a paint device that paints on a printer.</p>
<p>On Windows or Mac OS X, QPrinter uses the built-in printer drivers. On X11, QPrinter generates postscript and sends that to lpr, lp, or another <a href="qprinter.html#printProgram">printProgram</a>(). QPrinter can also print to any other <a href="qprintengine.html">QPrintEngine</a>.</p>
<p>QPrinter is used in much the same way as <a href="qwidget.html">QWidget</a> and <a href="qpixmap.html">QPixmap</a> are used. The big difference is that you must keep track of pages.</p>
<p>QPrinter supports a number of settable parameters, most of which can be changed by the end user through a <a href="qabstractprintdialog.html">QAbstractPrintDialog</a> print dialog. In general, QPrinter passes these functions onto the underlying <a href="qprintengine.html">QPrintEngine</a>.</p>
<p>The most important parameters are:</p>
<ul>
<li><a href="qprinter.html#setOrientation">setOrientation</a>() tells QPrinter which page orientation to use.</li>
<li><a href="qprinter.html#setPageSize">setPageSize</a>() tells QPrinter what page size to expect from the printer.</li>
<li><a href="qprinter.html#setResolution">setResolution</a>() tells QPrinter what resolution you wish the printer to provide (in dots per inch -- dpi).</li>
<li><a href="qprinter.html#setFullPage">setFullPage</a>() tells QPrinter whether you want to deal with the full page or just with the part the printer can draw on. The default is false, so that by default you should be able to paint on (0,0). If true the origin of the coordinate system will be in the top left corner of the paper and most probably the printer will not be able to paint something there due to its physical margins.</li>
<li><a href="qprinter.html#setNumCopies">setNumCopies</a>() tells QPrinter how many copies of the document it should print.</li>
</ul>
<p>Many of the settable functions can only be called before the actual printing begins (i.e., before <a href="qpainter.html#begin">QPainter.begin</a>() is called). This usually makes sense (e.g., you can't change the number of copies when you are halfway through printing). There are also some settings that the user sets (through the printer dialog) and that applications are expected to obey. See <a href="qabstractprintdialog.html">QAbstractPrintDialog</a>'s documentation for more details.</p>
<p>Once you start printing, calling <a href="qprinter.html#newPage">newPage</a>() is essential. You will probably also need to look at the device metrics for the printer.</p>
<p>If you want to abort the print job, <a href="qprinter.html#abort">abort</a>() will try its best to stop printing. It may cancel the entire job or just part of it.</p>
<p>If your current locale converts "," to ".", you will need to set a locale that doesn't do this (e.g. the "C" locale) before using QPrinter.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="ColorMode-enum" />QPrinter.ColorMode</h3><p>This enum type is used to indicate whether <a href="qprinter.html">QPrinter</a> should print in color or not.</p>
<table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr>
<th width="25%">Constant</th>
<th width="15%">Value</th>
<th width="60%">Description</th>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Color</tt></td>
<td align="center" valign="top"><tt>1</tt></td>
<td valign="top">print in color if available, otherwise in grayscale.</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.GrayScale</tt></td>
<td align="center" valign="top"><tt>0</tt></td>
<td valign="top">print in grayscale, even on color printers.</td>
</tr>
</table>
<br />
<br />
<h3 class="fn"><a name="Orientation-enum" />QPrinter.Orientation</h3><p>This enum type (not to be confused with <tt>Orientation</tt>) is used to specify each page's orientation.</p>
<table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr>
<th width="25%">Constant</th>
<th width="15%">Value</th>
<th width="60%">Description</th>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Portrait</tt></td>
<td align="center" valign="top"><tt>0</tt></td>
<td valign="top">the page's height is greater than its width.</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Landscape</tt></td>
<td align="center" valign="top"><tt>1</tt></td>
<td valign="top">the page's width is greater than its height.</td>
</tr>
</table>
<br />
<br />
<p>This type interacts with <a href="qprinter.html#PageSize-enum">QPrinter.PageSize</a> and <a href="qprinter.html#setFullPage">QPrinter.setFullPage</a>() to determine the final size of the page available to the application.</p>
<h3 class="fn"><a name="OutputFormat-enum" />QPrinter.OutputFormat</h3><p>The OutputFormat enum is used to describe the format <a href="qprinter.html">QPrinter</a> should use for printing.</p>
<table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr>
<th width="25%">Constant</th>
<th width="15%">Value</th>
<th width="60%">Description</th>
</tr>
<tr>
<td valign="top"><tt>QPrinter.NativeFormat</tt></td>
<td align="center" valign="top"><tt>0</tt></td>
<td valign="top"><a href="qprinter.html">QPrinter</a> will print output in the method given by the platform it is running on, e.g. This is how printing was traditionally done in Qt. This mode is the default.</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.PdfFormat</tt></td>
<td align="center" valign="top"><tt>1</tt></td>
<td valign="top"><a href="qprinter.html">QPrinter</a> will generate its output as a PDF file. As of Qt 4.1.3 PDF files generated by Qt are searchable on all platforms.</td>
</tr>
</table>
<br />
<br />
<h3 class="fn"><a name="PageOrder-enum" />QPrinter.PageOrder</h3><p>This enum type is used by <a href="qprinter.html">QPrinter</a> to tell the application program how to print.</p>
<table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr>
<th width="25%">Constant</th>
<th width="15%">Value</th>
<th width="60%">Description</th>
</tr>
<tr>
<td valign="top"><tt>QPrinter.FirstPageFirst</tt></td>
<td align="center" valign="top"><tt>0</tt></td>
<td valign="top">the lowest-numbered page should be printed first.</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.LastPageFirst</tt></td>
<td align="center" valign="top"><tt>1</tt></td>
<td valign="top">the highest-numbered page should be printed first.</td>
</tr>
</table>
<br />
<br />
<h3 class="fn"><a name="PageSize-enum" />QPrinter.PageSize</h3><p>This enum type specifies what paper size <a href="qprinter.html">QPrinter</a> should use. <a href="qprinter.html">QPrinter</a> does not check that the paper size is available; it just uses this information, together with <a href="qprinter.html#Orientation-enum">QPrinter.Orientation</a> and <a href="qprinter.html#setFullPage">QPrinter.setFullPage</a>(), to determine the printable area.</p>
<p>The defined sizes (with setFullPage(true)) are:</p>
<table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr>
<th width="25%">Constant</th>
<th width="15%">Value</th>
<th width="60%">Description</th>
</tr>
<tr>
<td valign="top"><tt>QPrinter.A0</tt></td>
<td align="center" valign="top"><tt>5</tt></td>
<td valign="top">841 x 1189 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.A1</tt></td>
<td align="center" valign="top"><tt>6</tt></td>
<td valign="top">594 x 841 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.A2</tt></td>
<td align="center" valign="top"><tt>7</tt></td>
<td valign="top">420 x 594 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.A3</tt></td>
<td align="center" valign="top"><tt>8</tt></td>
<td valign="top">297 x 420 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.A4</tt></td>
<td align="center" valign="top"><tt>0</tt></td>
<td valign="top">210 x 297 mm, 8.26 x 11.69 inches</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.A5</tt></td>
<td align="center" valign="top"><tt>9</tt></td>
<td valign="top">148 x 210 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.A6</tt></td>
<td align="center" valign="top"><tt>10</tt></td>
<td valign="top">105 x 148 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.A7</tt></td>
<td align="center" valign="top"><tt>11</tt></td>
<td valign="top">74 x 105 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.A8</tt></td>
<td align="center" valign="top"><tt>12</tt></td>
<td valign="top">52 x 74 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.A9</tt></td>
<td align="center" valign="top"><tt>13</tt></td>
<td valign="top">37 x 52 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.B0</tt></td>
<td align="center" valign="top"><tt>14</tt></td>
<td valign="top">1030 x 1456 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.B1</tt></td>
<td align="center" valign="top"><tt>15</tt></td>
<td valign="top">728 x 1030 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.B10</tt></td>
<td align="center" valign="top"><tt>16</tt></td>
<td valign="top">32 x 45 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.B2</tt></td>
<td align="center" valign="top"><tt>17</tt></td>
<td valign="top">515 x 728 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.B3</tt></td>
<td align="center" valign="top"><tt>18</tt></td>
<td valign="top">364 x 515 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.B4</tt></td>
<td align="center" valign="top"><tt>19</tt></td>
<td valign="top">257 x 364 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.B5</tt></td>
<td align="center" valign="top"><tt>1</tt></td>
<td valign="top">182 x 257 mm, 7.17 x 10.13 inches</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.B6</tt></td>
<td align="center" valign="top"><tt>20</tt></td>
<td valign="top">128 x 182 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.B7</tt></td>
<td align="center" valign="top"><tt>21</tt></td>
<td valign="top">91 x 128 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.B8</tt></td>
<td align="center" valign="top"><tt>22</tt></td>
<td valign="top">64 x 91 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.B9</tt></td>
<td align="center" valign="top"><tt>23</tt></td>
<td valign="top">45 x 64 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.C5E</tt></td>
<td align="center" valign="top"><tt>24</tt></td>
<td valign="top">163 x 229 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Comm10E</tt></td>
<td align="center" valign="top"><tt>25</tt></td>
<td valign="top">105 x 241 mm, U.S. Common 10 Envelope</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.DLE</tt></td>
<td align="center" valign="top"><tt>26</tt></td>
<td valign="top">110 x 220 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Executive</tt></td>
<td align="center" valign="top"><tt>4</tt></td>
<td valign="top">7.5 x 10 inches, 191 x 254 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Folio</tt></td>
<td align="center" valign="top"><tt>27</tt></td>
<td valign="top">210 x 330 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Ledger</tt></td>
<td align="center" valign="top"><tt>28</tt></td>
<td valign="top">432 x 279 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Legal</tt></td>
<td align="center" valign="top"><tt>3</tt></td>
<td valign="top">8.5 x 14 inches, 216 x 356 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Letter</tt></td>
<td align="center" valign="top"><tt>2</tt></td>
<td valign="top">8.5 x 11 inches, 216 x 279 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Tabloid</tt></td>
<td align="center" valign="top"><tt>29</tt></td>
<td valign="top">279 x 432 mm</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Custom</tt></td>
<td align="center" valign="top"><tt>30</tt></td>
<td valign="top">Unknown size</td>
</tr>
</table>
<br />
<br />
<p>With setFullPage(false) (the default), the metrics will be a bit smaller; how much depends on the printer in use.</p>
<h3 class="fn"><a name="PaperSource-enum" />QPrinter.PaperSource</h3><p>This enum type specifies what paper source <a href="qprinter.html">QPrinter</a> is to use. <a href="qprinter.html">QPrinter</a> does not check that the paper source is available; it just uses this information to try and set the paper source. Whether it will set the paper source depends on whether the printer has that particular source.</p>
<p><b>Warning:</b> This is currently only implemented for Windows.</p>
<table border="1" cellpadding="2" cellspacing="1" width="40%">
<tr>
<th width="60%">Constant</th>
<th width="40%">Value</th>
</tr>
<tr>
<td valign="top"><tt>QPrinter.OnlyOne</tt></td>
<td align="center" valign="top"><tt>0</tt></td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Lower</tt></td>
<td align="center" valign="top"><tt>1</tt></td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Middle</tt></td>
<td align="center" valign="top"><tt>2</tt></td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Manual</tt></td>
<td align="center" valign="top"><tt>3</tt></td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Envelope</tt></td>
<td align="center" valign="top"><tt>4</tt></td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.EnvelopeManual</tt></td>
<td align="center" valign="top"><tt>5</tt></td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Auto</tt></td>
<td align="center" valign="top"><tt>6</tt></td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Tractor</tt></td>
<td align="center" valign="top"><tt>7</tt></td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.SmallFormat</tt></td>
<td align="center" valign="top"><tt>8</tt></td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.LargeFormat</tt></td>
<td align="center" valign="top"><tt>9</tt></td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.LargeCapacity</tt></td>
<td align="center" valign="top"><tt>10</tt></td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Cassette</tt></td>
<td align="center" valign="top"><tt>11</tt></td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.FormSource</tt></td>
<td align="center" valign="top"><tt>12</tt></td>
</tr>
</table>
<br />
<br />
<h3 class="fn"><a name="PrinterMode-enum" />QPrinter.PrinterMode</h3><p>This enum describes the mode the printer should work in. It basically presets a certain resolution and working mode.</p>
<table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr>
<th width="25%">Constant</th>
<th width="15%">Value</th>
<th width="60%">Description</th>
</tr>
<tr>
<td valign="top"><tt>QPrinter.ScreenResolution</tt></td>
<td align="center" valign="top"><tt>0</tt></td>
<td valign="top">Sets the resolution of the print device to the screen resolution. This has the big advantage that the results obtained when painting on the printer will match more or less exactly the visible output on the screen. It is the easiest to use, as font metrics on the screen and on the printer are the same. This is the default value. ScreenResolution will produce a lower quality output than HighResolution and should only be used for drafts.</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.PrinterResolution</tt></td>
<td align="center" valign="top"><tt>1</tt></td>
<td valign="top">This value is deprecated. Is is equivalent to ScreenResolution on Unix and HighResolution on Windows and Mac. Due do the difference between ScreenResolution and HighResolution, use of this value may lead to non-portable printer code.</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.HighResolution</tt></td>
<td align="center" valign="top"><tt>2</tt></td>
<td valign="top">Use printer resolution on Windows, and set the resolution of the Postscript driver to 600dpi.</td>
</tr>
</table>
<br />
<br />
<h3 class="fn"><a name="PrinterState-enum" />QPrinter.PrinterState</h3><table border="1" cellpadding="2" cellspacing="1" width="40%">
<tr>
<th width="60%">Constant</th>
<th width="40%">Value</th>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Idle</tt></td>
<td align="center" valign="top"><tt>0</tt></td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Active</tt></td>
<td align="center" valign="top"><tt>1</tt></td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Aborted</tt></td>
<td align="center" valign="top"><tt>2</tt></td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Error</tt></td>
<td align="center" valign="top"><tt>3</tt></td>
</tr>
</table>
<br />
<br />
<h3 class="fn"><a name="PrintRange-enum" />QPrinter.PrintRange</h3><p>Used to specify the print range selection option.</p>
<table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr>
<th width="25%">Constant</th>
<th width="15%">Value</th>
<th width="60%">Description</th>
</tr>
<tr>
<td valign="top"><tt>QPrinter.AllPages</tt></td>
<td align="center" valign="top"><tt>0</tt></td>
<td valign="top">All pages should be printed.</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.Selection</tt></td>
<td align="center" valign="top"><tt>1</tt></td>
<td valign="top">Only the selection should be printed.</td>
</tr>
<tr>
<td valign="top"><tt>QPrinter.PageRange</tt></td>
<td align="center" valign="top"><tt>2</tt></td>
<td valign="top">The specified page range should be printed.</td>
</tr>
</table>
<br />
<br />
<p>See also <a href="qabstractprintdialog.html#PrintRange-enum">QAbstractPrintDialog.PrintRange</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QPrinter" />QPrinter.__init__ (<i>self</i>, <a href="qprinter.html#PrinterMode-enum">PrinterMode</a>&#160;<i>mode</i>&#160;=&#160;QPrinter.ScreenResolution)</h3><p>Creates a new printer object with the given <i>mode</i>.</p>
<h3 class="fn"><a name="abort" />bool QPrinter.abort (<i>self</i>)</h3><p>Aborts the current print run. Returns true if the print run was successfully aborted and <a href="qprinter.html#printerState">printerState</a>() will return <a href="qprinter.html#PrinterState-enum">QPrinter.Aborted</a>; otherwise returns false.</p>
<p>It is not always possible to abort a print job. For example, all the data has gone to the printer but the printer cannot or will not cancel the job when asked to.</p>
<h3 class="fn"><a name="collateCopies" />bool QPrinter.collateCopies (<i>self</i>)</h3><p>Returns true if collation is turned on when multiple copies is selected. Returns false if it is turned off when multiple copies is selected.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qprinter.html#setCollateCopies">setCollateCopies</a>().</p>
<h3 class="fn"><a name="colorMode" /><a href="qprinter.html#ColorMode-enum">ColorMode</a> QPrinter.colorMode (<i>self</i>)</h3><p>Returns the current color mode.</p>
<p>See also <a href="qprinter.html#setColorMode">setColorMode</a>().</p>
<h3 class="fn"><a name="creator" /><a href="qstring.html">QString</a> QPrinter.creator (<i>self</i>)</h3><p>Returns the name of the application that created the document.</p>
<p>See also <a href="qprinter.html#setCreator">setCreator</a>().</p>
<h3 class="fn"><a name="devType" />int QPrinter.devType (<i>self</i>)</h3><h3 class="fn"><a name="docName" /><a href="qstring.html">QString</a> QPrinter.docName (<i>self</i>)</h3><p>Returns the document name.</p>
<p>See also <a href="qprinter.html#setDocName">setDocName</a>().</p>
<h3 class="fn"><a name="fontEmbeddingEnabled" />bool QPrinter.fontEmbeddingEnabled (<i>self</i>)</h3><p>Returns true is font embedding is enabled.</p>
<p>Currently this option is only supported on X11.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qprinter.html#setFontEmbeddingEnabled">setFontEmbeddingEnabled</a>().</p>
<h3 class="fn"><a name="fromPage" />int QPrinter.fromPage (<i>self</i>)</h3><p>Returns the from-page setting. The default value is 0.</p>
<p>If fromPage() and <a href="qprinter.html#toPage">toPage</a>() both return 0 this signifies 'print the whole document'.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qprinter.html#setFromTo">setFromTo</a>() and <a href="qprinter.html#toPage">toPage</a>().</p>
<h3 class="fn"><a name="fullPage" />bool QPrinter.fullPage (<i>self</i>)</h3><p>Returns true if the origin of the printer's coordinate system is at the corner of the page and false if it is at the edge of the printable area.</p>
<p>See <a href="qprinter.html#setFullPage">setFullPage</a>() for details and caveats.</p>
<p>See also <a href="qprinter.html#setFullPage">setFullPage</a>() and <a href="qprinter.html#PageSize-enum">PageSize</a>.</p>
<h3 class="fn"><a name="metric" />int QPrinter.metric (<i>self</i>, <a href="qpaintdevice.html#PaintDeviceMetric-enum">QPaintDevice.PaintDeviceMetric</a>)</h3><h3 class="fn"><a name="newPage" />bool QPrinter.newPage (<i>self</i>)</h3><p>Tells the printer to eject the current page and to continue printing on a new page. Returns true if this was successful; otherwise returns false.</p>
<h3 class="fn"><a name="numCopies" />int QPrinter.numCopies (<i>self</i>)</h3><p>Returns the number of copies to be printed. The default value is 1.</p>
<p>On Windows and Mac OS X, this will always return 1 as these operating systems can internally handle the number of copies.</p>
<p>On X11, this value will return the number of times the application is required to print in order to match the number specified in the printer setup dialog. This has been done since some printer drivers are not capable of buffering up the copies and in those cases the application must make an explicit call to the print code for each copy.</p>
<p>See also <a href="qprinter.html#setNumCopies">setNumCopies</a>().</p>
<h3 class="fn"><a name="orientation" /><a href="qprinter.html#Orientation-enum">Orientation</a> QPrinter.orientation (<i>self</i>)</h3><p>Returns the orientation setting. This is driver-dependent, but is usually <a href="qprinter.html#Orientation-enum">QPrinter.Portrait</a>.</p>
<p>See also <a href="qprinter.html#setOrientation">setOrientation</a>().</p>
<h3 class="fn"><a name="outputFileName" /><a href="qstring.html">QString</a> QPrinter.outputFileName (<i>self</i>)</h3><p>Returns the name of the output file. By default, this is an empty string (indicating that the printer shouldn't print to file).</p>
<p>See also <a href="qprinter.html#setOutputFileName">setOutputFileName</a>().</p>
<h3 class="fn"><a name="outputFormat" /><a href="qprinter.html#OutputFormat-enum">OutputFormat</a> QPrinter.outputFormat (<i>self</i>)</h3><p>Returns the output format for this printer</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qprinter.html#setOutputFormat">setOutputFormat</a>().</p>
<h3 class="fn"><a name="pageOrder" /><a href="qprinter.html#PageOrder-enum">PageOrder</a> QPrinter.pageOrder (<i>self</i>)</h3><p>Returns the current page order.</p>
<p>The default page order is <tt>FirstPageFirst</tt>.</p>
<p>See also <a href="qprinter.html#setPageOrder">setPageOrder</a>().</p>
<h3 class="fn"><a name="pageRect" /><a href="qrect.html">QRect</a> QPrinter.pageRect (<i>self</i>)</h3><p>Returns the page's rectangle; this is usually smaller than the <a href="qprinter.html#paperRect">paperRect</a>() since the page normally has margins between its borders and the paper.</p>
<p>See also <a href="qprinter.html#pageSize">pageSize</a>().</p>
<h3 class="fn"><a name="pageSize" /><a href="qprinter.html#PageSize-enum">PageSize</a> QPrinter.pageSize (<i>self</i>)</h3><p>Returns the printer page size. The default value is driver-dependent.</p>
<p>See also <a href="qprinter.html#setPageSize">setPageSize</a>(), <a href="qprinter.html#pageRect">pageRect</a>(), and <a href="qprinter.html#paperRect">paperRect</a>().</p>
<h3 class="fn"><a name="paintEngine" /><a href="qpaintengine.html">QPaintEngine</a> QPrinter.paintEngine (<i>self</i>)</h3><p>Returns the paint engine used by the printer.</p>
<p>Reimplemented from <a href="qpaintdevice.html#paintEngine">QPaintDevice</a>.</p>
<h3 class="fn"><a name="paperRect" /><a href="qrect.html">QRect</a> QPrinter.paperRect (<i>self</i>)</h3><p>Returns the paper's rectangle; this is usually larger than the <a href="qprinter.html#pageRect">pageRect</a>().</p>
<p>See also <a href="qprinter.html#pageRect">pageRect</a>().</p>
<h3 class="fn"><a name="paperSource" /><a href="qprinter.html#PaperSource-enum">PaperSource</a> QPrinter.paperSource (<i>self</i>)</h3><p>Returns the printer's paper source. This is <tt>Manual</tt> or a printer tray or paper cassette.</p>
<p>See also <a href="qprinter.html#setPaperSource">setPaperSource</a>().</p>
<h3 class="fn"><a name="printEngine" /><a href="qprintengine.html">QPrintEngine</a> QPrinter.printEngine (<i>self</i>)</h3><p>Returns the print engine used by the printer.</p>
<p>This function was introduced in Qt 4.1.</p>
<h3 class="fn"><a name="printerName" /><a href="qstring.html">QString</a> QPrinter.printerName (<i>self</i>)</h3><p>Returns the printer name. This value is initially set to the name of the default printer.</p>
<p>See also <a href="qprinter.html#setPrinterName">setPrinterName</a>().</p>
<h3 class="fn"><a name="printerSelectionOption" /><a href="qstring.html">QString</a> QPrinter.printerSelectionOption (<i>self</i>)</h3><p>Returns the printer options selection string. This is useful only if the print command has been explicitly set.</p>
<p>The default value (an empty string) implies that the printer should be selected in a system-dependent manner.</p>
<p>Any other value implies that the given value should be used.</p>
<p><b>Warning:</b> This function is not available on Windows.</p>
<p>See also <a href="qprinter.html#setPrinterSelectionOption">setPrinterSelectionOption</a>().</p>
<h3 class="fn"><a name="printerState" /><a href="qprinter.html#PrinterState-enum">PrinterState</a> QPrinter.printerState (<i>self</i>)</h3><p>Returns the current state of the printer. This may not always be accurate (for example if the printer doesn't have the capability of reporting its state to the operating system).</p>
<h3 class="fn"><a name="printProgram" /><a href="qstring.html">QString</a> QPrinter.printProgram (<i>self</i>)</h3><p>Returns the name of the program that sends the print output to the printer.</p>
<p>The default is to return an empty string; meaning that <a href="qprinter.html">QPrinter</a> will try to be smart in a system-dependent way. On X11 only, you can set it to something different to use a specific print program. On the other platforms, this returns an empty string.</p>
<p>See also <a href="qprinter.html#setPrintProgram">setPrintProgram</a>() and <a href="qprinter.html#setPrinterSelectionOption">setPrinterSelectionOption</a>().</p>
<h3 class="fn"><a name="printRange" /><a href="qprinter.html#PrintRange-enum">PrintRange</a> QPrinter.printRange (<i>self</i>)</h3><p>Returns the page range of the <a href="qprinter.html">QPrinter</a>. After the print setup dialog has been opened, this function returns the value selected by the user.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qprinter.html#setPrintRange">setPrintRange</a>().</p>
<h3 class="fn"><a name="resolution" />int QPrinter.resolution (<i>self</i>)</h3><p>Returns the current assumed resolution of the printer, as set by <a href="qprinter.html#setResolution">setResolution</a>() or by the printer driver.</p>
<p>See also <a href="qprinter.html#setResolution">setResolution</a>().</p>
<h3 class="fn"><a name="setCollateCopies" />QPrinter.setCollateCopies (<i>self</i>, bool&#160;<i>collate</i>)</h3><p>Sets the default value for collation checkbox when the print dialog appears. If <i>collate</i> is true, it will enable <a href="qprinter-qt3.html#setCollateCopiesEnabled">setCollateCopiesEnabled</a>(). The default value is false. This value will be changed by what the user presses in the print dialog.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qprinter.html#collateCopies">collateCopies</a>().</p>
<h3 class="fn"><a name="setColorMode" />QPrinter.setColorMode (<i>self</i>, <a href="qprinter.html#ColorMode-enum">ColorMode</a>)</h3><p>Sets the printer's color mode to <i>newColorMode</i>, which can be either <tt>Color</tt> or <tt>GrayScale</tt>.</p>
<p>See also <a href="qprinter.html#colorMode">colorMode</a>().</p>
<h3 class="fn"><a name="setCreator" />QPrinter.setCreator (<i>self</i>, <a href="qstring.html">QString</a>)</h3><p>Sets the name of the application that created the document to <i>creator</i>.</p>
<p>This function is only applicable to the X11 version of Qt. If no creator name is specified, the creator will be set to "Qt" followed by some version number.</p>
<p>See also <a href="qprinter.html#creator">creator</a>().</p>
<h3 class="fn"><a name="setDocName" />QPrinter.setDocName (<i>self</i>, <a href="qstring.html">QString</a>)</h3><p>Sets the document name to <i>name</i>.</p>
<p>See also <a href="qprinter.html#docName">docName</a>().</p>
<h3 class="fn"><a name="setEngines" />QPrinter.setEngines (<i>self</i>, <a href="qprintengine.html">QPrintEngine</a>&#160;<i>printEngine</i>, <a href="qpaintengine.html">QPaintEngine</a>&#160;<i>paintEngine</i>)</h3><p>This function is used by subclasses of <a href="qprinter.html">QPrinter</a> to specify custom print engine and paint engine.</p>
<p><a href="qprinter.html">QPrinter</a> does not take ownership of the engines, so you need to manage these engine instances yourself.</p>
<p>Note that changing the engines will reset the printer state and all its properties.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qprinter.html#printEngine">printEngine</a>(), <a href="qprinter.html#paintEngine">paintEngine</a>(), and <a href="qprinter.html#setOutputFormat">setOutputFormat</a>().</p>
<h3 class="fn"><a name="setFontEmbeddingEnabled" />QPrinter.setFontEmbeddingEnabled (<i>self</i>, bool&#160;<i>enable</i>)</h3><p>Enabled or disables font embedding depending on <i>enable</i>.</p>
<p>Currently this option is only supported on X11.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qprinter.html#fontEmbeddingEnabled">fontEmbeddingEnabled</a>().</p>
<h3 class="fn"><a name="setFromTo" />QPrinter.setFromTo (<i>self</i>, int&#160;<i>fromPage</i>, int&#160;<i>toPage</i>)</h3><p>Sets the from-page and to-page settings to <i>from</i> and <i>to</i> respectively.</p>
<p>The from-page and to-page settings specify what pages to print.</p>
<p>If from and to both return 0 this signifies 'print the whole document'.</p>
<p>This function is useful mostly to set a default value that the user can override in the print dialog when you call <a href="qprinter-qt3.html#setup">setup</a>().</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qprinter.html#fromPage">fromPage</a>() and <a href="qprinter.html#toPage">toPage</a>().</p>
<h3 class="fn"><a name="setFullPage" />QPrinter.setFullPage (<i>self</i>, bool)</h3><p>Sets <a href="qprinter.html">QPrinter</a> to have the origin of the coordinate system at the top-left corner of the paper if <i>fp</i> is true, or where it thinks the top-left corner of the printable area is if <i>fp</i> is false.</p>
<p>The default is false. You can (probably) print on (0,0), and the device metrics will report something smaller than the size indicated by <a href="qprinter.html#PageSize-enum">PageSize</a>. (Note that <a href="qprinter.html">QPrinter</a> may be wrong on Unix systems: it does not have perfect knowledge of the physical printer.)</p>
<p>If <i>fp</i> is true, the device metrics will report the exact same size as indicated by <tt>PageSize</tt>. It probably isn't possible to print on the entire page because of the printer's physical margins, so the application must account for the margins itself.</p>
<p>See also <a href="qprinter.html#PageSize-enum">PageSize</a>, <a href="qprinter.html#setPageSize">setPageSize</a>(), <a href="qprinter.html#fullPage">fullPage</a>(), <a href="qpaintdevice.html#width">width</a>(), and <a href="qpaintdevice.html#height">height</a>().</p>
<h3 class="fn"><a name="setNumCopies" />QPrinter.setNumCopies (<i>self</i>, int)</h3><p>Sets the number of copies to be printed to <i>numCopies</i>.</p>
<p>The printer driver reads this setting and prints the specified number of copies.</p>
<p>See also <a href="qprinter.html#numCopies">numCopies</a>().</p>
<h3 class="fn"><a name="setOrientation" />QPrinter.setOrientation (<i>self</i>, <a href="qprinter.html#Orientation-enum">Orientation</a>)</h3><p>Sets the print orientation to <i>orientation</i>.</p>
<p>The orientation can be either <a href="qprinter.html#Orientation-enum">QPrinter.Portrait</a> or <a href="qprinter.html#Orientation-enum">QPrinter.Landscape</a>.</p>
<p>The printer driver reads this setting and prints using the specified orientation.</p>
<p>On Windows and Mac OS X, this option can be changed while printing and will take effect from the next call to <a href="qprinter.html#newPage">newPage</a>().</p>
<p>See also <a href="qprinter.html#orientation">orientation</a>().</p>
<h3 class="fn"><a name="setOutputFileName" />QPrinter.setOutputFileName (<i>self</i>, <a href="qstring.html">QString</a>)</h3><p>Sets the name of the output file to <i>fileName</i>.</p>
<p>Setting a null or empty name (0 or "") disables printing to a file. Setting a non-empty name enables printing to a file.</p>
<p>See also <a href="qprinter.html#outputFileName">outputFileName</a>() and <a href="qprinter-qt3.html#setOutputToFile">setOutputToFile</a>().</p>
<h3 class="fn"><a name="setOutputFormat" />QPrinter.setOutputFormat (<i>self</i>, <a href="qprinter.html#OutputFormat-enum">OutputFormat</a>&#160;<i>format</i>)</h3><p>Sets the output format for this printer to <i>format</i>.</p>
<p>Setting the output format will reset the state of the printer</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qprinter.html#outputFormat">outputFormat</a>().</p>
<h3 class="fn"><a name="setPageOrder" />QPrinter.setPageOrder (<i>self</i>, <a href="qprinter.html#PageOrder-enum">PageOrder</a>)</h3><p>Sets the page order to <i>pageOrder</i>.</p>
<p>The page order can be <a href="qprinter.html#PageOrder-enum">QPrinter.FirstPageFirst</a> or <a href="qprinter.html#PageOrder-enum">QPrinter.LastPageFirst</a>. The application is responsible for reading the page order and printing accordingly.</p>
<p>This function is mostly useful for setting a default value that the user can override in the print dialog.</p>
<p>See also <a href="qprinter.html#pageOrder">pageOrder</a>().</p>
<h3 class="fn"><a name="setPageSize" />QPrinter.setPageSize (<i>self</i>, <a href="qprinter.html#PageSize-enum">PageSize</a>)</h3><p>Sets the printer page size to <i>newPageSize</i> if that size is supported. The result if undefined if <i>newPageSize</i> is not supported.</p>
<p>The default page size is driver-dependent.</p>
<p>This function is useful mostly for setting a default value that the user can override in the print dialog.</p>
<p>See also <a href="qprinter.html#pageSize">pageSize</a>(), <a href="qprinter.html#PageSize-enum">PageSize</a>, <a href="qprinter.html#setFullPage">setFullPage</a>(), <a href="qprinter.html#setResolution">setResolution</a>(), <a href="qprinter.html#pageRect">pageRect</a>(), and <a href="qprinter.html#paperRect">paperRect</a>().</p>
<h3 class="fn"><a name="setPaperSource" />QPrinter.setPaperSource (<i>self</i>, <a href="qprinter.html#PaperSource-enum">PaperSource</a>)</h3><p>Sets the paper source setting to <i>source</i>.</p>
<p>Windows only: This option can be changed while printing and will take effect from the next call to <a href="qprinter.html#newPage">newPage</a>()</p>
<p>See also <a href="qprinter.html#paperSource">paperSource</a>().</p>
<h3 class="fn"><a name="setPrinterName" />QPrinter.setPrinterName (<i>self</i>, <a href="qstring.html">QString</a>)</h3><p>Sets the printer name to <i>name</i>.</p>
<p>See also <a href="qprinter.html#printerName">printerName</a>().</p>
<h3 class="fn"><a name="setPrinterSelectionOption" />QPrinter.setPrinterSelectionOption (<i>self</i>, <a href="qstring.html">QString</a>)</h3><p>Sets the printer to use <i>option</i> to select the printer. <i>option</i> is null by default (which implies that Qt should be smart enough to guess correctly), but it can be set to other values to use a specific printer selection option.</p>
<p>If the printer selection option is changed while the printer is active, the current print job may or may not be affected.</p>
<p><b>Warning:</b> This function is not available on Windows.</p>
<p>See also <a href="qprinter.html#printerSelectionOption">printerSelectionOption</a>().</p>
<h3 class="fn"><a name="setPrintProgram" />QPrinter.setPrintProgram (<i>self</i>, <a href="qstring.html">QString</a>)</h3><p>Sets the name of the program that should do the print job to <i>printProg</i>.</p>
<p>On X11, this function sets the program to call with the PostScript output. On other platforms, it has no effect.</p>
<p>See also <a href="qprinter.html#printProgram">printProgram</a>().</p>
<h3 class="fn"><a name="setPrintRange" />QPrinter.setPrintRange (<i>self</i>, <a href="qprinter.html#PrintRange-enum">PrintRange</a>&#160;<i>range</i>)</h3><p>Sets the print range option in to be <i>range</i>.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qprinter.html#printRange">printRange</a>().</p>
<h3 class="fn"><a name="setResolution" />QPrinter.setResolution (<i>self</i>, int)</h3><p>Requests that the printer prints at <i>dpi</i> or as near to <i>dpi</i> as possible.</p>
<p>This setting affects the coordinate system as returned by, for example <a href="qpainter.html#viewport">QPainter.viewport</a>().</p>
<p>This function must be called before <a href="qpainter.html#begin">QPainter.begin</a>() to have an effect on all platforms.</p>
<p>See also <a href="qprinter.html#resolution">resolution</a>() and <a href="qprinter.html#setPageSize">setPageSize</a>().</p>
<h3 class="fn"><a name="supportedResolutions" />int-list QPrinter.supportedResolutions (<i>self</i>)</h3><p>Returns a list of the resolutions (a list of dots-per-inch integers) that the printer says it supports.</p>
<p>For X11 where all printing is directly to postscript, this function will always return a one item list containing only the postscript resolution, i.e., 72 (72 dpi -- but see <a href="qprinter.html#PrinterMode-enum">PrinterMode</a>).</p>
<h3 class="fn"><a name="toPage" />int QPrinter.toPage (<i>self</i>)</h3><p>Returns the to-page setting. The default value is 0.</p>
<p>If <a href="qprinter.html#fromPage">fromPage</a>() and toPage() both return 0 this signifies 'print the whole document'.</p>
<p>The programmer is responsible for reading this setting and printing accordingly.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qprinter.html#setFromTo">setFromTo</a>() and <a href="qprinter.html#fromPage">fromPage</a>().</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td width="25%">PyQt&#160;4.0.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.trolltech.com">Trolltech&#160;AS</a> 2006</td><td align="right" width="25%">Qt&#160;4.1.4</td></tr></table></div></address></body></html>