import QtQuick
import QtQuick.Dialogs
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Pdf
import QtCore
Rectangle{
width: 800
height: 600
visible: true
//title: qsTr("PDF Upload and Preview")
FileDialog {
id: fileDialog
title: "Please choose a PDF file"
nameFilters: ["PDF files (*.pdf)"]
currentFolder: StandardPaths.writableLocation(StandardPaths.DesktopLocation)
onAccepted: {
pdf.source = fileDialog.currentFile
}
}
PdfMultiPageView {
id: pdfViewer
anchors.fill: parent
document:PdfDocument{
id:pdf
}
}
Button {
text: "Choose PDF"
onClicked: fileDialog.open()
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
}
}