QPagedPaintDevice¶
The
QPagedPaintDevice
class represents a paint device that supports multiple pages. More…
Inherited by: QPrinter
Synopsis¶
Functions¶
def
devicePageLayout
()def
margins
()def
pageLayout
()def
pageSize
()def
pageSizeMM
()def
setPageLayout
(pageLayout)def
setPageMargins
(margins)def
setPageMargins
(margins, units)def
setPageOrientation
(orientation)def
setPageSize
(pageSize)
Virtual functions¶
def
newPage
()def
setMargins
(margins)def
setPageSize
(size)def
setPageSizeMM
(size)
Detailed Description¶
Paged paint devices are used to generate output for printing or for formats like PDF.
QPdfWriter
andQPrinter
inherit from it.
- class PySide2.QtGui.QPagedPaintDevice¶
Note
This constructor is deprecated.
Constructs a new paged paint device.
- PySide2.QtGui.QPagedPaintDevice.PageSize¶
This enum type lists the available page sizes as defined in the Postscript PPD standard. These values are duplicated in
QPageSize
andQPrinter
and those types and enum will be merged in Qt 6.The defined sizes are:
Constant
Description
QPagedPaintDevice.A0
841 x 1189 mm
QPagedPaintDevice.A1
594 x 841 mm
QPagedPaintDevice.A2
420 x 594 mm
QPagedPaintDevice.A3
297 x 420 mm
QPagedPaintDevice.A4
210 x 297 mm, 8.26 x 11.69 inches
QPagedPaintDevice.A5
148 x 210 mm
QPagedPaintDevice.A6
105 x 148 mm
QPagedPaintDevice.A7
74 x 105 mm
QPagedPaintDevice.A8
52 x 74 mm
QPagedPaintDevice.A9
37 x 52 mm
QPagedPaintDevice.B0
1000 x 1414 mm
QPagedPaintDevice.B1
707 x 1000 mm
QPagedPaintDevice.B2
500 x 707 mm
QPagedPaintDevice.B3
353 x 500 mm
QPagedPaintDevice.B4
250 x 353 mm
QPagedPaintDevice.B5
176 x 250 mm, 6.93 x 9.84 inches
QPagedPaintDevice.B6
125 x 176 mm
QPagedPaintDevice.B7
88 x 125 mm
QPagedPaintDevice.B8
62 x 88 mm
QPagedPaintDevice.B9
33 x 62 mm
QPagedPaintDevice.B10
31 x 44 mm
QPagedPaintDevice.C5E
163 x 229 mm
QPagedPaintDevice.Comm10E
105 x 241 mm, U.S. Common 10 Envelope
QPagedPaintDevice.DLE
110 x 220 mm
QPagedPaintDevice.Executive
7.5 x 10 inches, 190.5 x 254 mm
QPagedPaintDevice.Folio
210 x 330 mm
QPagedPaintDevice.Ledger
431.8 x 279.4 mm
QPagedPaintDevice.Legal
8.5 x 14 inches, 215.9 x 355.6 mm
QPagedPaintDevice.Letter
8.5 x 11 inches, 215.9 x 279.4 mm
QPagedPaintDevice.Tabloid
279.4 x 431.8 mm
QPagedPaintDevice.Custom
Unknown, or a user defined size.
QPagedPaintDevice.A10
QPagedPaintDevice.A3Extra
QPagedPaintDevice.A4Extra
QPagedPaintDevice.A4Plus
QPagedPaintDevice.A4Small
QPagedPaintDevice.A5Extra
QPagedPaintDevice.B5Extra
QPagedPaintDevice.JisB0
QPagedPaintDevice.JisB1
QPagedPaintDevice.JisB2
QPagedPaintDevice.JisB3
QPagedPaintDevice.JisB4
QPagedPaintDevice.JisB5
QPagedPaintDevice.JisB6
,
QPagedPaintDevice.JisB7
QPagedPaintDevice.JisB8
QPagedPaintDevice.JisB9
QPagedPaintDevice.JisB10
QPagedPaintDevice.AnsiA
= Letter
QPagedPaintDevice.AnsiB
= Ledger
QPagedPaintDevice.AnsiC
QPagedPaintDevice.AnsiD
QPagedPaintDevice.AnsiE
QPagedPaintDevice.LegalExtra
QPagedPaintDevice.LetterExtra
QPagedPaintDevice.LetterPlus
QPagedPaintDevice.LetterSmall
QPagedPaintDevice.TabloidExtra
QPagedPaintDevice.ArchA
QPagedPaintDevice.ArchB
QPagedPaintDevice.ArchC
QPagedPaintDevice.ArchD
QPagedPaintDevice.ArchE
QPagedPaintDevice.Imperial7x9
QPagedPaintDevice.Imperial8x10
QPagedPaintDevice.Imperial9x11
QPagedPaintDevice.Imperial9x12
QPagedPaintDevice.Imperial10x11
QPagedPaintDevice.Imperial10x13
QPagedPaintDevice.Imperial10x14
QPagedPaintDevice.Imperial12x11
QPagedPaintDevice.Imperial15x11
QPagedPaintDevice.ExecutiveStandard
QPagedPaintDevice.Note
QPagedPaintDevice.Quarto
QPagedPaintDevice.Statement
QPagedPaintDevice.SuperA
QPagedPaintDevice.SuperB
QPagedPaintDevice.Postcard
QPagedPaintDevice.DoublePostcard
QPagedPaintDevice.Prc16K
QPagedPaintDevice.Prc32K
QPagedPaintDevice.Prc32KBig
QPagedPaintDevice.FanFoldUS
QPagedPaintDevice.FanFoldGerman
QPagedPaintDevice.FanFoldGermanLegal
QPagedPaintDevice.EnvelopeB4
QPagedPaintDevice.EnvelopeB5
QPagedPaintDevice.EnvelopeB6
QPagedPaintDevice.EnvelopeC0
QPagedPaintDevice.EnvelopeC1
QPagedPaintDevice.EnvelopeC2
QPagedPaintDevice.EnvelopeC3
QPagedPaintDevice.EnvelopeC4
QPagedPaintDevice.EnvelopeC5
= C5E
QPagedPaintDevice.EnvelopeC6
QPagedPaintDevice.EnvelopeC65
QPagedPaintDevice.EnvelopeC7
QPagedPaintDevice.EnvelopeDL
= DLE
QPagedPaintDevice.Envelope9
QPagedPaintDevice.Envelope10
=
QPagedPaintDevice.Envelope11
QPagedPaintDevice.Envelope12
QPagedPaintDevice.Envelope14
QPagedPaintDevice.EnvelopeMonarch
QPagedPaintDevice.EnvelopePersonal
QPagedPaintDevice.EnvelopeChou3
QPagedPaintDevice.EnvelopeChou4
QPagedPaintDevice.EnvelopeInvite
QPagedPaintDevice.EnvelopeItalian
QPagedPaintDevice.EnvelopeKaku2
QPagedPaintDevice.EnvelopeKaku3
QPagedPaintDevice.EnvelopePrc1
QPagedPaintDevice.EnvelopePrc2
QPagedPaintDevice.EnvelopePrc3
QPagedPaintDevice.EnvelopePrc4
QPagedPaintDevice.EnvelopePrc5
QPagedPaintDevice.EnvelopePrc6
QPagedPaintDevice.EnvelopePrc7
QPagedPaintDevice.EnvelopePrc8
QPagedPaintDevice.EnvelopePrc9
QPagedPaintDevice.EnvelopePrc10
QPagedPaintDevice.EnvelopeYou4
QPagedPaintDevice.LastPageSize
=
Due to historic reasons
Executive
is not the same as the standard Postscript and Windows Executive size, useExecutiveStandard
instead.The Postscript standard size
Folio
is different to the Windows DMPAPER_FOLIO size, use the Postscript standard sizeFanFoldGermanLegal
if needed.
- PySide2.QtGui.QPagedPaintDevice.PdfVersion¶
The enum describes the version of the PDF file that is produced by
QPrinter
orQPdfWriter
.Constant
Description
QPagedPaintDevice.PdfVersion_1_4
A PDF 1.4 compatible document is produced.
QPagedPaintDevice.PdfVersion_A1b
A PDF/A-1b compatible document is produced.
QPagedPaintDevice.PdfVersion_1_6
A PDF 1.6 compatible document is produced. This value was added in Qt 5.12.
New in version 5.10.
- PySide2.QtGui.QPagedPaintDevice.devicePageLayout()¶
- Return type:
Note
This function is deprecated.
Returns the internal device page layout.
- PySide2.QtGui.QPagedPaintDevice.margins()¶
- Return type:
Note
This function is deprecated.
Use
pageLayout()
. instead. Returns the current margins of the paint device. The default is 0.Margins are specified in millimeters.
See also
- PySide2.QtGui.QPagedPaintDevice.newPage()¶
- Return type:
bool
Starts a new page. Returns
true
on success.
- PySide2.QtGui.QPagedPaintDevice.pageLayout()¶
- Return type:
Returns the current page layout. Use this method to access the current
QPageSize
,Orientation
,QMarginsF
, fullRect() and paintRect().Note that you cannot use the setters on the returned object, you must either call the individual
QPagedPaintDevice
setters or usesetPageLayout()
.
- PySide2.QtGui.QPagedPaintDevice.pageSize()¶
- Return type:
Note
This function is deprecated.
Returns the currently used page size.
See also
- PySide2.QtGui.QPagedPaintDevice.pageSizeMM()¶
- Return type:
Note
This function is deprecated.
Use
pageLayout()
.pageSize()
instead.Returns the page size in millimeters.
See also
- PySide2.QtGui.QPagedPaintDevice.setMargins(margins)¶
- Parameters:
margins –
PySide2.QtGui.QPagedPaintDevice.Margins
Note
This function is deprecated.
Use
setPageMargins
(QMarginsF
,Unit
) instead. Sets the margins to be used tomargins
.Margins are specified in millimeters.
The margins are purely a hint to the drawing method. They don’t affect the coordinate system or clipping.
See also
- PySide2.QtGui.QPagedPaintDevice.setPageLayout(pageLayout)¶
- Parameters:
pageLayout –
PySide2.QtGui.QPageLayout
- Return type:
bool
Sets the page layout to
newPageLayout
.You should call this before calling
begin()
, or immediately before callingnewPage()
to apply the new page layout to a new page. You should not call any painting methods between a call to andnewPage()
as the wrong paint metrics may be used.Returns true if the page layout was successfully set to
newPageLayout
.See also
- PySide2.QtGui.QPagedPaintDevice.setPageMargins(margins)¶
- Parameters:
margins –
PySide2.QtCore.QMarginsF
- Return type:
bool
Set the page
margins
in the current page layout units.You should call this before calling
begin()
, or immediately before callingnewPage()
to apply the new margins to a new page. You should not call any painting methods between a call to andnewPage()
as the wrong paint metrics may be used.To get the current page margins use
pageLayout()
.margins()
.Returns true if the page margins were successfully set to
margins
.See also
- PySide2.QtGui.QPagedPaintDevice.setPageMargins(margins, units)
- Parameters:
margins –
PySide2.QtCore.QMarginsF
units –
Unit
- Return type:
bool
Set the page
margins
defined in the givenunits
.You should call this before calling
begin()
, or immediately before callingnewPage()
to apply the new margins to a new page. You should not call any painting methods between a call tosetPageMargins()
andnewPage()
as the wrong paint metrics may be used.To get the current page margins use
pageLayout()
.margins()
.Returns true if the page margins were successfully set to
margins
.See also
- PySide2.QtGui.QPagedPaintDevice.setPageOrientation(orientation)¶
- Parameters:
orientation –
Orientation
- Return type:
bool
Sets the page
orientation
.The page orientation is used to define the orientation of the page size when obtaining the page rect.
You should call this before calling
begin()
, or immediately before callingnewPage()
to apply the new orientation to a new page. You should not call any painting methods between a call to andnewPage()
as the wrong paint metrics may be used.To get the current
Orientation
usepageLayout()
.orientation()
.Returns true if the page orientation was successfully set to
orientation
.See also
- PySide2.QtGui.QPagedPaintDevice.setPageSize(size)¶
- Parameters:
size –
PageSize
Note
This function is deprecated.
Sets the size of the a page to
size
.See also
- PySide2.QtGui.QPagedPaintDevice.setPageSize(pageSize)
- Parameters:
pageSize –
PySide2.QtGui.QPageSize
- Return type:
bool
- PySide2.QtGui.QPagedPaintDevice.setPageSizeMM(size)¶
- Parameters:
size –
PySide2.QtCore.QSizeF
Note
This function is deprecated.
Use
setPageSize
(QPageSize
) instead. Sets the page size tosize
.size
is specified in millimeters.If the size matches a standard
PageSize
then that page size will be used, otherwiseCustom
will be set.See also
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.