QPdfPageRenderer#
The QPdfPageRenderer
class encapsulates the rendering of pages of a PDF document. More…
Synopsis#
Functions#
def
document
()def
renderMode
()def
requestPage
(pageNumber, imageSize[, options=QPdfDocumentRenderOptions()])def
setDocument
(document)def
setRenderMode
(mode)
Signals#
def
documentChanged
(document)def
pageRendered
(pageNumber, imageSize, image, options, requestId)def
renderModeChanged
(renderMode)
Detailed Description#
The QPdfPageRenderer
contains a queue that collects all render requests that are invoked through requestPage()
. Depending on the configured RenderMode
the QPdfPageRenderer
processes this queue in the main UI thread on next event loop invocation (RenderMode::SingleThreaded
) or in a separate worker thread (RenderMode::MultiThreaded
) and emits the result through the pageRendered() signal for each request once the rendering is done.
See also
- class PySide6.QtPdf.QPdfPageRenderer#
PySide6.QtPdf.QPdfPageRenderer(parent)
- Parameters
parent –
PySide6.QtCore.QObject
Constructs a page renderer object with parent object parent
.
- PySide6.QtPdf.QPdfPageRenderer.RenderMode#
This enum describes how the pages are rendered.
Constant
Description
QPdfPageRenderer.RenderMode.MultiThreaded
All pages are rendered in a separate worker thread.
QPdfPageRenderer.RenderMode.SingleThreaded
All pages are rendered in the main UI thread (default).
See also
- PySide6.QtPdf.QPdfPageRenderer.document()#
- Return type
This property holds The document instance this object renders the pages from..
By default, this property is nullptr
.
See also
- PySide6.QtPdf.QPdfPageRenderer.documentChanged(document)#
- Parameters
document –
PySide6.QtPdf.QPdfDocument
- PySide6.QtPdf.QPdfPageRenderer.pageRendered(pageNumber, imageSize, image, options, requestId)#
- Parameters
pageNumber – int
imageSize –
PySide6.QtCore.QSize
image –
PySide6.QtGui.QImage
options –
PySide6.QtPdf.QPdfDocumentRenderOptions
requestId – int
- PySide6.QtPdf.QPdfPageRenderer.renderMode()#
- Return type
This property holds The mode the renderer uses to render the pages..
By default, this property is RenderMode::SingleThreaded
.
See also
setRenderMode()
RenderMode
- PySide6.QtPdf.QPdfPageRenderer.renderModeChanged(renderMode)#
- Parameters
renderMode –
RenderMode
- PySide6.QtPdf.QPdfPageRenderer.requestPage(pageNumber, imageSize[, options=QPdfDocumentRenderOptions()])#
- Parameters
pageNumber – int
imageSize –
PySide6.QtCore.QSize
options –
PySide6.QtPdf.QPdfDocumentRenderOptions
- Return type
int
Requests the renderer to render the page pageNumber
into a QImage
of size imageSize
according to the provided options
.
Once the rendering is done the pageRendered() signal is emitted with the result as parameters.
The return value is an ID that uniquely identifies the render request. If a request with the same parameters is still in the queue, the ID of that queued request is returned.
- PySide6.QtPdf.QPdfPageRenderer.setDocument(document)#
- Parameters
document –
PySide6.QtPdf.QPdfDocument
This property holds The document instance this object renders the pages from..
By default, this property is nullptr
.
See also
- PySide6.QtPdf.QPdfPageRenderer.setRenderMode(mode)#
- Parameters
mode –
RenderMode
This property holds The mode the renderer uses to render the pages..
By default, this property is RenderMode::SingleThreaded
.
See also
setRenderMode()
RenderMode