Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Source PdfDocument



  • Hi,

    Trying new module QtPdf, the source property working with qrc path like below but how to pass path like D:/Test.pdf?

    PdfDocument {
                id: document
                source: Qt.resolvedUrl("qrc:/pdfviewer/resources/test2.pdf")
                onStatusChanged: if (status === PdfDocument.Error) errorDialog.open()
            }
    

    I try but not working:

    PdfDocument {
                id: document
                source: "file:///D:/test2.pdf"
                onStatusChanged: if (status === PdfDocument.Error) errorDialog.open()
            }
    

    thank you for you help


  • Moderators

    @philxxx609 hi,
    have you tried source: "D:/test2.pdf" or Qt.resolvedUrl("D:/test2.pdf")


Log in to reply