QPagedPaintDevice

The QPagedPaintDevice class represents a paint device that supports multiple pages. More

Inheritance diagram of PySide2.QtGui.QPagedPaintDevice

Inherited by: QPrinter

Synopsis

Functions

Virtual functions

Detailed Description

Paged paint devices are used to generate output for printing or for formats like PDF. QPdfWriter and QPrinter 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 and QPrinter 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, use ExecutiveStandard instead.

The Postscript standard size Folio is different to the Windows DMPAPER_FOLIO size, use the Postscript standard size FanFoldGermanLegal if needed.

PySide2.QtGui.QPagedPaintDevice.PdfVersion

The enum describes the version of the PDF file that is produced by QPrinter or QPdfWriter .

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:

PySide2.QtGui.QPageLayout

Note

This function is deprecated.

Returns the internal device page layout.

PySide2.QtGui.QPagedPaintDevice.margins()
Return type:

PySide2.QtGui.QPagedPaintDevice.Margins

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

setMargins()

PySide2.QtGui.QPagedPaintDevice.newPage()
Return type:

bool

Starts a new page. Returns true on success.

PySide2.QtGui.QPagedPaintDevice.pageLayout()
Return type:

PySide2.QtGui.QPageLayout

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 use setPageLayout() .

PySide2.QtGui.QPagedPaintDevice.pageSize()
Return type:

PageSize

Note

This function is deprecated.

Returns the currently used page size.

See also

setPageSize()

PySide2.QtGui.QPagedPaintDevice.pageSizeMM()
Return type:

PySide2.QtCore.QSizeF

Note

This function is deprecated.

Use pageLayout() . pageSize() instead.

Returns the page size in millimeters.

See also

setPageSizeMM()

PySide2.QtGui.QPagedPaintDevice.setMargins(margins)
Parameters:

marginsPySide2.QtGui.QPagedPaintDevice.Margins

Note

This function is deprecated.

Use setPageMargins ( QMarginsF , Unit ) instead. Sets the margins to be used to margins .

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

margins()

PySide2.QtGui.QPagedPaintDevice.setPageLayout(pageLayout)
Parameters:

pageLayoutPySide2.QtGui.QPageLayout

Return type:

bool

Sets the page layout to newPageLayout .

You should call this before calling begin() , or immediately before calling newPage() to apply the new page layout to a new page. You should not call any painting methods between a call to and newPage() as the wrong paint metrics may be used.

Returns true if the page layout was successfully set to newPageLayout .

See also

pageLayout()

PySide2.QtGui.QPagedPaintDevice.setPageMargins(margins)
Parameters:

marginsPySide2.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 calling newPage() to apply the new margins to a new page. You should not call any painting methods between a call to and newPage() 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

pageLayout()

PySide2.QtGui.QPagedPaintDevice.setPageMargins(margins, units)
Parameters:
Return type:

bool

Set the page margins defined in the given units .

You should call this before calling begin() , or immediately before calling newPage() to apply the new margins to a new page. You should not call any painting methods between a call to setPageMargins() and newPage() 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

pageLayout()

PySide2.QtGui.QPagedPaintDevice.setPageOrientation(orientation)
Parameters:

orientationOrientation

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 calling newPage() to apply the new orientation to a new page. You should not call any painting methods between a call to and newPage() as the wrong paint metrics may be used.

To get the current Orientation use pageLayout() . orientation() .

Returns true if the page orientation was successfully set to orientation .

See also

pageLayout()

PySide2.QtGui.QPagedPaintDevice.setPageSize(size)
Parameters:

sizePageSize

Note

This function is deprecated.

Sets the size of the a page to size .

See also

setPageSizeMM()

PySide2.QtGui.QPagedPaintDevice.setPageSize(pageSize)
Parameters:

pageSizePySide2.QtGui.QPageSize

Return type:

bool

PySide2.QtGui.QPagedPaintDevice.setPageSizeMM(size)
Parameters:

sizePySide2.QtCore.QSizeF

Note

This function is deprecated.

Use setPageSize ( QPageSize ) instead. Sets the page size to size . size is specified in millimeters.

If the size matches a standard PageSize then that page size will be used, otherwise Custom will be set.

See also

pageSizeMM()