Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Source PdfDocument
Qt 6.11 is out! See what's new in the release blog

Source PdfDocument

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 370 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    philxxx609
    wrote on last edited by
    #1

    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

    J.HilkJ 1 Reply Last reply
    0
    • P philxxx609

      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

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

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


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved