PythonQt.QtGui.QPrinter · declarations 003
Back to PythonQt.QtGui.QPrinter
setDocName
setDocName(arg__1: str) -> None
X.setDocName(arg__1)
Supplemental documentation: Qt 5 reference:
void QPrinter::setDocName(const QString \&name)
Sets the document name to name.
On X11, the document name is for example used as the default output filename in QPrintDialog. Note that the document name does not affect the file name if the printer is printing to a file. Use the setOutputFile() function for this.
See also docName() and QPrintEngine::PrintEnginePropertyKey.
Upstream PySide2 reference signatures (binding differences may apply):
setDocName(self, arg__1: str) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setDocName
setDoubleSidedPrinting
setDoubleSidedPrinting(enable: bool) -> None
X.setDoubleSidedPrinting(enable)
Upstream PySide2 reference signatures (binding differences may apply):
setDoubleSidedPrinting(self, enable: bool) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setDoubleSidedPrinting
setDuplex
setDuplex(duplex: Any) -> None
X.setDuplex(duplex)
Supplemental documentation: Qt 5 reference:
void QPrinter::setDuplex(QPrinter::DuplexMode duplex)
Enables double sided printing based on the duplex mode.
This function was introduced in Qt 4.4.
See also duplex().
Upstream PySide2 reference signatures (binding differences may apply):
setDuplex(self, duplex: PySide2.QtPrintSupport.QPrinter.DuplexMode) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setDuplex
setEngines
setEngines(printEngine: Any, paintEngine: Any) -> None
X.setEngines(printEngine, paintEngine)
Supplemental documentation: Qt 5 reference:
[protected] void QPrinter::setEngines(QPrintEngine *printEngine, QPaintEngine *paintEngine)
This function is used by subclasses of QPrinter to specify custom print and paint engines (printEngine and paintEngine, respectively).
QPrinter does not take ownership of the engines, so you need to manage these engine instances yourself.
Note that changing the engines will reset the printer state and all its properties.
This function was introduced in Qt 4.1.
See also printEngine(), paintEngine(), and setOutputFormat().
Upstream PySide2 reference signatures (binding differences may apply):
setEngines(self, printEngine: PySide2.QtPrintSupport.QPrintEngine, paintEngine: PySide2.QtGui.QPaintEngine) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setEngines
setFontEmbeddingEnabled
setFontEmbeddingEnabled(enable: bool) -> None
X.setFontEmbeddingEnabled(enable)
Supplemental documentation: Qt 5 reference:
void QPrinter::setFontEmbeddingEnabled(bool enable)
Enabled or disables font embedding depending on enable.
This function was introduced in Qt 4.1.
See also fontEmbeddingEnabled().
Upstream PySide2 reference signatures (binding differences may apply):
setFontEmbeddingEnabled(self, enable: bool) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setFontEmbeddingEnabled
setFromTo
setFromTo(fromPage: int, toPage: int) -> None
X.setFromTo(fromPage, toPage)
Supplemental documentation: Qt 5 reference:
void QPrinter::setFromTo(int from, int to)
Sets the range of pages to be printed to cover the pages with numbers specified by from and to, where from corresponds to the first page in the range and to corresponds to the last.
Note: Pages in a document are numbered according to the convention that the first page is page 1. However, if from and to are both set to 0, the whole document will be printed.
This function is mostly used to set a default value that the user can override in the print dialog when you call setup().
This function was introduced in Qt 4.1.
See also fromPage() and toPage().
Upstream PySide2 reference signatures (binding differences may apply):
setFromTo(self, fromPage: int, toPage: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setFromTo
setFullPage
setFullPage(arg__1: bool) -> None
X.setFullPage(arg__1)
Supplemental documentation: Qt 5 reference:
void QPrinter::setFullPage(bool fp)
If fp is true, enables support for painting over the entire page; otherwise restricts painting to the printable area reported by the device.
By default, full page printing is disabled. In this case, the origin of the QPrinter's coordinate system coincides with the top-left corner of the printable area.
If full page printing is enabled, the origin of the QPrinter's coordinate system coincides with the top-left corner of the paper itself. In this case, the device metrics will report the exact same dimensions as indicated by PaperSize. It may not be possible to print on the entire physical page because of the printer's margins, so the application must account for the margins itself.
See also fullPage(), pageLayout(), setPageSize(), width(), and height().
Upstream PySide2 reference signatures (binding differences may apply):
setFullPage(self, arg__1: bool) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setFullPage
setMargins
setMargins(m: Any) -> None
X.setMargins(m)
Upstream PySide2 reference signatures (binding differences may apply):
setMargins(self, m: PySide2.QtGui.QPagedPaintDevice.Margins) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setMargins
setNumCopies
setNumCopies(arg__1: int) -> None
X.setNumCopies(arg__1)
Upstream PySide2 reference signatures (binding differences may apply):
setNumCopies(self, arg__1: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setNumCopies
setOrientation
setOrientation(arg__1: Any) -> None
X.setOrientation(arg__1)
Upstream PySide2 reference signatures (binding differences may apply):
setOrientation(self, arg__1: PySide2.QtPrintSupport.QPrinter.Orientation) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setOrientation
setOutputFileName
setOutputFileName(arg__1: str) -> None
X.setOutputFileName(arg__1)
Supplemental documentation: Qt 5 reference:
void QPrinter::setOutputFileName(const QString \&fileName)
Sets the name of the output file to fileName.
Setting a null or empty name (0 or "") disables printing to a file. Setting a non-empty name enables printing to a file.
This can change the value of outputFormat(). If the file name has the ".pdf" suffix PDF is generated. If the file name has a suffix other than ".pdf", the output format used is the one set with setOutputFormat().
QPrinter uses Qt's cross-platform PDF print engines respectively. If you can produce this format natively, for example macOS can generate PDF's from its print engine, set the output format back to NativeFormat.
See also outputFileName() and setOutputFormat().
Upstream PySide2 reference signatures (binding differences may apply):
setOutputFileName(self, arg__1: str) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setOutputFileName
setOutputFormat
setOutputFormat(format: Any) -> None
X.setOutputFormat(format)
Supplemental documentation: Qt 5 reference:
void QPrinter::setOutputFormat(QPrinter::OutputFormat format)
Sets the output format for this printer to format.
If format is the same value as currently set then no change will be made.
If format is NativeFormat then the printerName will be set to the default printer. If there are no valid printers configured then no change will be made. If you want to set NativeFormat with a specific printerName then use setPrinterName().
This function was introduced in Qt 4.1.
See also outputFormat() and setPrinterName().
Upstream PySide2 reference signatures (binding differences may apply):
setOutputFormat(self, format: PySide2.QtPrintSupport.QPrinter.OutputFormat) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setOutputFormat
setPageLayout
setPageLayout(pageLayout: Any) -> bool
X.setPageLayout(pageLayout) -> bool
Supplemental documentation: Qt 5 reference:
bool QPrinter::setPageLayout(const QPageLayout \&newLayout)
Sets the page layout to newLayout.
If the newLayout is not valid for the current printer then the page layout will not be changed. For example, if the page size is not supported by the printer, or if the margins fall outside the printable area.
Returns true if the page layout was successfully set to newLayout.
This function was introduced in Qt 5.3.
See also pageLayout(), setPageSize(), setPageOrientation(), and setPageMargins().
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setPageLayout
setPageMargins
setPageMargins(left: Any, top: Any, right: Any, bottom: Any, unit: Any) -> Any
X.setPageMargins(left, top, right, bottom, unit)
Supplemental documentation: Qt 5 reference:
bool QPrinter::setPageMargins(const QMarginsF \&margins)
Set the page margins to margins using the current units. Returns true if the page
margins were set successfully.
See also pageLayout() and setPageLayout().
bool QPrinter::setPageMargins(const QMarginsF \&margins, QPageLayout::Unit units)
Set the page margins to margins in the given units. If units are not provided then the current units are used.
If in Full Page mode then no check is performed on the margins set, otherwise the margins must fall within the printable area for the page size on the current printer.
To obtain the current page margins use pageLayout().margins().
Returns true if the page margins was successfully set to margins.
This function was introduced in Qt 5.3.
See also pageLayout() and setPageLayout().
Upstream PySide2 reference signatures (binding differences may apply):
setPageMargins(self, left: float, top: float, right: float, bottom: float, unit: PySide2.QtPrintSupport.QPrinter.Unit) -> None
setPageMargins(self, margins: PySide2.QtCore.QMarginsF) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setPageMargins
setPageOrder
setPageOrder(arg__1: Any) -> None
X.setPageOrder(arg__1)
Supplemental documentation: Qt 5 reference:
void QPrinter::setPageOrder(QPrinter::PageOrder pageOrder)
Sets the page order to pageOrder.
The page order can be QPrinter::FirstPageFirst or QPrinter::LastPageFirst. The application is responsible for reading the page order and printing accordingly.
This function is mostly useful for setting a default value that the user can override in the print dialog.
This function is only supported under X11.
See also pageOrder().
Upstream PySide2 reference signatures (binding differences may apply):
setPageOrder(self, arg__1: PySide2.QtPrintSupport.QPrinter.PageOrder) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setPageOrder
setPageOrientation
setPageOrientation(orientation: Any) -> bool
X.setPageOrientation(orientation) -> bool
Supplemental documentation: Qt 5 reference:
bool QPrinter::setPageOrientation(QPageLayout::Orientation orientation)
Sets the page orientation to QPageLayout::Portrait or QPageLayout::Landscape.
The printer driver reads this setting and prints the page using the specified orientation.
On Windows and Mac, this option can be changed while printing and will take effect from the next call to newPage().
To obtain the current QPageLayout::Orientation use pageLayout().orientation().
Returns true if the page orientation was successfully set to orientation.
This function was introduced in Qt 5.3.
See also pageLayout() and setPageLayout().
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setPageOrientation
setPageSize
setPageSize(arg__1: Any) -> Any
X.setPageSize(arg__1)
Supplemental documentation: Qt 5 reference:
bool QPrinter::setPageSize(const QPageSize \&pageSize)
Sets the page size to pageSize.
If the pageSize is not valid for the current printer then the page size will not be changed.
Changing the page size may affect the current page margins if they fall outside the printable margins for the new page size on the current printer.
To obtain the current QPageSize use pageLayout().pageSize().
Returns true if the page size was successfully set to pageSize.
This function was introduced in Qt 5.3.
See also pageSize(), pageLayout(), and setPageLayout().
Upstream PySide2 reference signatures (binding differences may apply):
setPageSize(self, arg__1: PySide2.QtGui.QPageSize) -> bool
setPageSize(self, arg__1: PySide2.QtGui.QPagedPaintDevice.PageSize) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setPageSize
setPageSizeMM
setPageSizeMM(size: Any) -> None
X.setPageSizeMM(size)
Upstream PySide2 reference signatures (binding differences may apply):
setPageSizeMM(self, size: PySide2.QtCore.QSizeF) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setPageSizeMM
setPaperName
setPaperName(paperName: str) -> None
X.setPaperName(paperName)
Upstream PySide2 reference signatures (binding differences may apply):
setPaperName(self, paperName: str) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setPaperName
setPaperSize
setPaperSize(paperSize: Any, unit: Any) -> None
X.setPaperSize(paperSize, unit)
Upstream PySide2 reference signatures (binding differences may apply):
setPaperSize(self, arg__1: PySide2.QtGui.QPagedPaintDevice.PageSize) -> None
setPaperSize(self, paperSize: PySide2.QtCore.QSizeF, unit: PySide2.QtPrintSupport.QPrinter.Unit) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setPaperSize
setPaperSource
setPaperSource(arg__1: Any) -> None
X.setPaperSource(arg__1)
Supplemental documentation: Qt 5 reference:
void QPrinter::setPaperSource(QPrinter::PaperSource source)
Sets the paper source setting to source.
Windows only: This option can be changed while printing and will take effect from the next call to newPage()
See also paperSource().
Upstream PySide2 reference signatures (binding differences may apply):
setPaperSource(self, arg__1: PySide2.QtPrintSupport.QPrinter.PaperSource) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setPaperSource
setPrintProgram
setPrintProgram(arg__1: str) -> None
X.setPrintProgram(arg__1)
Supplemental documentation: Qt 5 reference:
void QPrinter::setPrintProgram(const QString \&printProg)
Sets the name of the program that should do the print job to printProg.
On X11, this function sets the program to call with the PDF output. On other platforms, it has no effect.
See also printProgram().
Upstream PySide2 reference signatures (binding differences may apply):
setPrintProgram(self, arg__1: str) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setPrintProgram
setPrintRange
setPrintRange(range: Any) -> None
X.setPrintRange(range)
Supplemental documentation: Qt 5 reference:
void QPrinter::setPrintRange(QPrinter::PrintRange range)
Sets the print range option in to be range.
This function was introduced in Qt 4.1.
See also printRange().
Upstream PySide2 reference signatures (binding differences may apply):
setPrintRange(self, range: PySide2.QtPrintSupport.QPrinter.PrintRange) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setPrintRange
setPrinterName
setPrinterName(arg__1: str) -> None
X.setPrinterName(arg__1)
Supplemental documentation: Qt 5 reference:
void QPrinter::setPrinterName(const QString \&name)
Sets the printer name to name.
If the name is empty then the output format will be set to PdfFormat.
If the name is not a valid printer then no change will be made.
If the name is a valid printer then the output format will be set to NativeFormat.
See also printerName(), isValid(), and setOutputFormat().
Upstream PySide2 reference signatures (binding differences may apply):
setPrinterName(self, arg__1: str) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setPrinterName
setResolution
setResolution(arg__1: int) -> None
X.setResolution(arg__1)
Supplemental documentation: Qt 5 reference:
void QPrinter::setResolution(int dpi)
Requests that the printer prints at dpi or as near to dpi as possible.
This setting affects the coordinate system as returned by, for example QPainter::viewport().
This function must be called before QPainter::begin() to have an effect on all platforms.
See also resolution() and setPaperSize().
Upstream PySide2 reference signatures (binding differences may apply):
setResolution(self, arg__1: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setResolution
setWinPageSize
setWinPageSize(winPageSize: int) -> None
X.setWinPageSize(winPageSize)
Upstream PySide2 reference signatures (binding differences may apply):
setWinPageSize(self, winPageSize: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setWinPageSize
supportedResolutions
supportedResolutions() -> tuple
X.supportedResolutions() -> tuple
Supplemental documentation: Qt 5 reference:
QList\<int> QPrinter::supportedResolutions() const
Returns a list of the resolutions (a list of dots-per-inch integers) that the printer says it supports.
For X11 where all printing is directly to PDF, this function will always return a one item list containing only the PDF resolution, i.e., 72 (72 dpi -- but see PrinterMode).
Upstream PySide2 reference signatures (binding differences may apply):
supportedResolutions(self) -> typing.List[int]
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#supportedResolutions
supportsMultipleCopies
supportsMultipleCopies() -> bool
X.supportsMultipleCopies() -> bool
Supplemental documentation: Qt 5 reference:
bool QPrinter::supportsMultipleCopies() const
Returns true if the printer supports printing multiple copies of the same document in
one job; otherwise false is returned.
On most systems this function will return true. However, on X11 systems that do not support CUPS, this function will return false. That means the application has to handle the number of copies by printing the same document the required number of times.
This function was introduced in Qt 4.7.
See also setCopyCount() and copyCount().
Upstream PySide2 reference signatures (binding differences may apply):
supportsMultipleCopies(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#supportsMultipleCopies
toPage
toPage() -> int
X.toPage() -> int
Supplemental documentation: Qt 5 reference:
int QPrinter::toPage() const
Returns the number of the last page in a range of pages to be printed (the "to page" setting). Pages in a document are numbered according to the convention that the first page is page 1.
By default, this function returns a special value of 0, meaning that the "to page" setting is unset.
Note: If fromPage() and toPage() both return 0, this indicates that the whole document will be printed.
The programmer is responsible for reading this setting and printing accordingly.
This function was introduced in Qt 4.1.
See also setFromTo() and fromPage().
Upstream PySide2 reference signatures (binding differences may apply):
toPage(self) -> int
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#toPage
winPageSize
winPageSize() -> int
X.winPageSize() -> int
Upstream PySide2 reference signatures (binding differences may apply):
winPageSize(self) -> int
Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#winPageSize