PdfPageView QML Type

A PDF viewer component to show one page a time. 更多...

import 語句: import QtQuick.Pdf
繼承:

Rectangle

特性

方法

詳細描述

PdfPageView provides a PDF viewer component that shows one whole page at a time, without scrolling. It 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 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 模塊目錄,並按需修改它。

另請參閱 PdfScrollablePageView , PdfMultiPageView ,和 PdfStyle .

特性文檔編製

backEnabled : bool [read-only]

This property indicates if it is possible to go back in the navigation history to a previous-viewed page.

另請參閱 PdfPageNavigator::backAvailable and back ().

currentPage : int [read-only]

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 .

另請參閱 PdfPageNavigator::currentPage .

document : PdfDocument [required]

A PdfDocument 對象具有有效 source URL is required:

import QtQuick
import QtQuick.Pdf
PdfPageView {
    document: PdfDocument { source: "my.pdf" }
}
					

forwardEnabled : bool [read-only]

This property indicates if it is possible to go to next location in the navigation history.

另請參閱 PdfPageNavigator::forwardAvailable and forward ().

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

This property holds a PdfSearchModel containing the list of search results for a given searchString .

另請參閱 PdfSearchModel .

searchString : string

This property holds the search string that the user may choose to search for. It is typically used in a binding to the text property of a TextField .

另請參閱 searchModel .

selectedText : PdfDocument

選中文本。

sourceSize : size

This property holds the scaled width and height of the full-frame image.

另請參閱 Image.sourceSize .

status : int

此特性保持 渲染狀態 當前頁麵 .

zoomEnabled : bool

This property holds whether the user can use the pinch gesture or Control + mouse wheel to zoom. The default is true .

When the user zooms the page, the size of PdfPageView 改變。

方法文檔編製

void back ()

Scrolls the view back to the previous page that the user visited most recently; or does nothing if there is no previous location on the navigation stack.

另請參閱 PdfPageNavigator::back (), currentPage ,和 backEnabled .

void copySelectionToClipboard ()

拷貝選中文本 (若有的話) 到 係統剪貼闆 .

另請參閱 selectAll ().

void forward ()

Scrolls the view to the page that the user was viewing when the back () method was called; or does nothing if there is no "next" location on the navigation stack.

另請參閱 PdfPageNavigator::forward () 和 currentPage .

void goToLocation ( int page , point location , real zoom )

捲動視圖到 locationpage ,若可能的話,並設置 zoom 級彆。

另請參閱 PdfPageNavigator::jump () 和 currentPage .

void goToPage ( int page )

Changes the view to the page , if possible.

另請參閱 PdfPageNavigator::jump () 和 currentPage .

void resetScale ()

設置 renderScale 迴到其默認值 1 .

void scaleToPage ( real width , real height )

設置 renderScale such that the whole first page will fit into a viewport with the given width and height . The resulting renderScale depends on page rotation: the page will fit into the viewport at a larger size if it is first rotated to have a matching aspect ratio.

void scaleToWidth ( real width , real height )

設置 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 .

void searchBack ()

遞減 searchModel 的當前結果 so that the view will jump to the previous search result.

void searchForward ()

遞增 searchModel 的當前結果 so that the view will jump to the next search result.

void selectAll ()

Selects all the text on the 當前頁麵 , and makes it available as the system selection on systems that support that feature.

另請參閱 copySelectionToClipboard ().