- class QPagedPaintDevice¶
The
QPagedPaintDevice
class represents a paint device that supports multiple pages. More…Inherited by:
QPrinter
,QPdfWriter
Synopsis¶
Methods¶
def
pageLayout()
def
pageRanges()
Virtual methods¶
def
newPage()
def
setPageLayout()
def
setPageMargins()
def
setPageRanges()
def
setPageSize()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
Paged paint devices are used to generate output for printing or for formats like PDF.
QPdfWriter
and QPrinter inherit from it.- class PdfVersion¶
The PdfVersion 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.
QPagedPaintDevice.PdfVersion_X4
A PDF/X-4 compatible document is produced.
- abstract newPage()¶
- Return type:
bool
Starts a new page. Returns
true
on success.- 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()
.- pageRanges()¶
- Return type:
Returns the page ranges associated with this device.
See also
setPageRanges()
QPageRanges
toPage()
- setPageLayout(pageLayout)¶
- Parameters:
pageLayout –
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 setPageLayout() andnewPage()
as the wrong paint metrics may be used.Returns true if the page layout was successfully set to
newPageLayout
.See also
- setPageMargins(margins[, units=QPageLayout.Millimeter])¶
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 to setPageMargins() 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
- 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 setPageOrientation() 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
- setPageRanges(ranges)¶
- Parameters:
ranges –
QPageRanges
Sets the page ranges for this device to
ranges
.See also
Sets the page size to
pageSize
.To get the current
QPageSize
usepageLayout()
.pageSize().You should call this before calling
begin()
, or immediately before callingnewPage()
to apply the new page size to a new page. You should not call any painting methods between a call to setPageSize() andnewPage()
as the wrong paint metrics may be used.Returns true if the page size was successfully set to
pageSize
.See also