PySide6.QtPdf.QPdfPageRenderer¶
- class QPdfPageRenderer¶
- The - QPdfPageRendererclass encapsulates the rendering of pages of a PDF document.- Details- The - QPdfPageRenderercontains a queue that collects all render requests that are invoked through- requestPage(). Depending on the configured- RenderModethe- QPdfPageRendererprocesses 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 - Synopsis¶- Properties¶- documentᅟ- Instance this object renders the pages from
- renderModeᅟ- Mode the renderer uses to render the pages
 - Methods¶- def - __init__()
- def - document()
- def - renderMode()
- def - requestPage()
- def - setDocument()
- def - setRenderMode()
 - Signals¶
- def - pageRendered()
 - 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 - class RenderMode¶
- This enum describes how the pages are rendered. - Constant - Description - QPdfPageRenderer.RenderMode.RenderMode.MultiThreaded - All pages are rendered in a separate worker thread. - QPdfPageRenderer.RenderMode.RenderMode.SingleThreaded - All pages are rendered in the main UI thread (default). - See also 
 - Note - Properties can be used directly when - from __feature__ import true_propertyis used or via accessor functions otherwise.- property documentᅟ: QPdfDocument¶
 - This property holds The document instance this object renders the pages from.. - By default, this property is - nullptr.- See also - Access functions:
 - property renderModeᅟ: QPdfPageRenderer.RenderMode¶
 - This property holds The mode the renderer uses to render the pages.. - By default, this property is - RenderMode::SingleThreaded.- See also - Access functions:
 - __init__()¶
 - __init__(parent)
- Parameters:
- parent – - QObject
 
 - Constructs a page renderer object with parent object - parent.- document()¶
- Return type:
 
 - Returns the document this objects renders the pages from, or a - nullptrif none has been set before.- See also - Getter of property - documentᅟ.- documentChanged(document)¶
- Parameters:
- document – - QPdfDocument
 
 - Notification signal of property - documentᅟ.- pageRendered(pageNumber, imageSize, image, options, requestId)¶
- Parameters:
- pageNumber – int 
- imageSize – - QSize
- image – - QImage
- options – - QPdfDocumentRenderOptions
- requestId – int 
 
 
 - renderMode()¶
- Return type:
 
 - Returns the mode of how the pages are rendered. - See also - Getter of property - renderModeᅟ.- renderModeChanged(renderMode)¶
- Parameters:
- renderMode – - RenderMode
 
 - Notification signal of property - renderModeᅟ.- requestPage(pageNumber, imageSize[, options=QPdfDocumentRenderOptions()])¶
- Parameters:
- pageNumber – int 
- imageSize – - QSize
- options – - QPdfDocumentRenderOptions
 
- Return type:
- int 
 
 - Requests the renderer to render the page - pageNumberinto a QImage of size- imageSizeaccording 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. - setDocument(document)¶
- Parameters:
- document – - QPdfDocument
 
 - Sets the - documentthis object renders the pages from.- See also - Setter of property - documentᅟ.- setRenderMode(mode)¶
- Parameters:
- mode – - RenderMode
 
 - Sets the mode of how the pages are rendered to - mode.- See also - Setter of property - renderModeᅟ.