QPdfView#
A PDF viewer widget. More…
Synopsis#
Functions#
def
document
()def
documentMargins
()def
pageMode
()def
pageNavigator
()def
pageSpacing
()def
setDocument
(document)def
setDocumentMargins
(margins)def
setPageSpacing
(spacing)def
zoomFactor
()def
zoomMode
()
Slots#
def
setPageMode
(mode)def
setZoomFactor
(factor)def
setZoomMode
(mode)
Signals#
def
documentChanged
(document)def
documentMarginsChanged
(documentMargins)def
pageModeChanged
(pageMode)def
pageSpacingChanged
(pageSpacing)def
zoomFactorChanged
(zoomFactor)def
zoomModeChanged
(zoomMode)
Detailed Description#
QPdfView
is a PDF viewer widget that offers a user experience similar to many common PDF viewer applications, with two modes
. In the MultiPage
mode, it supports flicking through the pages in the entire document, with narrow gaps between the page images. In the SinglePage
mode, it shows one page at a time.
- class PySide6.QtPdfWidgets.QPdfView#
PySide6.QtPdfWidgets.QPdfView(parent)
- Parameters
parent –
PySide6.QtWidgets.QWidget
Constructs a PDF viewer with parent widget parent
.
- PySide6.QtPdfWidgets.QPdfView.PageMode#
This enum describes the overall behavior of the PDF viewer:
Constant
Description
QPdfView.PageMode.SinglePage
Show one page at a time.
QPdfView.PageMode.MultiPage
Allow scrolling through all pages in the document.
- PySide6.QtPdfWidgets.QPdfView.ZoomMode#
This enum describes the magnification behavior of the PDF viewer:
Constant
Description
QPdfView.ZoomMode.Custom
Use
zoomFactor
only.QPdfView.ZoomMode.FitToWidth
Automatically choose a zoom factor so that the width of the page fits in the view.
QPdfView.ZoomMode.FitInView
Automatically choose a zoom factor so that the entire page fits in the view.
- PySide6.QtPdfWidgets.QPdfView.document()#
- Return type
This property holds the document to be viewed.
- PySide6.QtPdfWidgets.QPdfView.documentChanged(document)#
- Parameters
document –
PySide6.QtPdf.QPdfDocument
- PySide6.QtPdfWidgets.QPdfView.documentMargins()#
- Return type
This property holds the margins around the page view.
- PySide6.QtPdfWidgets.QPdfView.documentMarginsChanged(documentMargins)#
- Parameters
documentMargins –
PySide6.QtCore.QMargins
This property holds whether to show one page at a time, or all pages in the document. The default is SinglePage
.
- Return type
This accessor returns the navigation stack that will handle back/forward navigation.
- PySide6.QtPdfWidgets.QPdfView.pageSpacing()#
- Return type
int
This property holds the size of the padding between pages in the MultiPage
mode
.
- PySide6.QtPdfWidgets.QPdfView.pageSpacingChanged(pageSpacing)#
- Parameters
pageSpacing – int
- PySide6.QtPdfWidgets.QPdfView.setDocument(document)#
- Parameters
document –
PySide6.QtPdf.QPdfDocument
This property holds the document to be viewed.
- PySide6.QtPdfWidgets.QPdfView.setDocumentMargins(margins)#
- Parameters
margins –
PySide6.QtCore.QMargins
This property holds the margins around the page view.
This property holds whether to show one page at a time, or all pages in the document. The default is SinglePage
.
- PySide6.QtPdfWidgets.QPdfView.setPageSpacing(spacing)#
- Parameters
spacing – int
This property holds the size of the padding between pages in the MultiPage
mode
.
- PySide6.QtPdfWidgets.QPdfView.setZoomFactor(factor)#
- Parameters
factor – float
This property holds the ratio of pixels to points. The default is 1
, meaning one point (1/72 of an inch) equals 1 logical pixel.
This property indicates whether to use a custom size for the page(s), or zoom them to fit to the view. The default is CustomZoom
.
- PySide6.QtPdfWidgets.QPdfView.zoomFactor()#
- Return type
float
This property holds the ratio of pixels to points. The default is 1
, meaning one point (1/72 of an inch) equals 1 logical pixel.
- PySide6.QtPdfWidgets.QPdfView.zoomFactorChanged(zoomFactor)#
- Parameters
zoomFactor – float
This property indicates whether to use a custom size for the page(s), or zoom them to fit to the view. The default is CustomZoom
.