PdfScrollablePageView QML Type
A complete PDF viewer component to show one page a time, with scrolling. More...
|Import Statement:||import QtQuick.Pdf|
- backEnabled : bool
- currentPage : int
- document : PdfDocument
- forwardEnabled : bool
- pageRotation : real
- renderScale : real
- searchModel : PdfSearchModel
- searchString : string
- selectedText : PdfDocument
- sourceSize : size
- status : int
- void back()
- void copySelectionToClipboard()
- void forward()
- void goToLocation(int page, point location, real zoom)
- void goToPage(int page)
- void resetScale()
- void scaleToPage(real width, real height)
- void scaleToWidth(real width, real height)
- void searchBack()
- void searchForward()
- void selectAll()
PdfScrollablePageView provides a PDF viewer component that shows one page at a time, with scrollbars to move around the page. It also supports selecting text and copying it to the clipboard, zooming in and out, clicking an internal link to jump to another section in the document, rotating the view, and searching for text. The pdfviewer example demonstrates how to use these features in an application.
The implementation is a QML assembly of smaller building blocks that are available separately. In case you want to make changes in your own version of this component, you can copy the QML, which is installed into the
QtQuick/Pdf/qml module directory, and modify it as needed.
[read-only] backEnabled : bool
[read-only] currentPage : int
This property holds the zero-based page number of the page visible in the scrollable view. If there is no current page, it holds -1.
This property is read-only, and is typically used in a binding (or
onCurrentPageChanged script) to update the part of the user interface that shows the current page number, such as a SpinBox.
See also PdfPageNavigator::currentPage.
[required] document : PdfDocument
[read-only] forwardEnabled : bool
pageRotation : real
This property holds the clockwise rotation of the pages.
The default value is
0 degrees (that is, no rotation relative to the orientation of the pages as stored in the PDF file).
renderScale : real
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.
searchModel : PdfSearchModel
searchString : string
selectedText : PdfDocument
The selected text.
sourceSize : size
This property holds the scaled width and height of the full-frame image.
See also Image.sourceSize.
void goToLocation(int page, point location, real zoom)
void goToPage(int page)
Sets renderScale back to its default value of
void scaleToPage(real width, real height)
void scaleToWidth(real width, real height)
Sets renderScale such that the width of the first page will fit into a viewport with the given width and height. If the page is not rotated, it will be scaled so that its width fits width. If it is rotated +/- 90 degrees, it will be scaled so that its width fits height.
Decrements the searchModel's current result so that the view will jump to the previous search result.
Increments the searchModel's current result so that the view will jump to the next search result.
© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.