No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Download pdf in the mobile version of the application

    Help
    3
    3
    684
    Loading More Posts
    • 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.
    • A
      aiai last edited by

      Hello! When you click on the button, the pdf file should download to the phone. In chrome, he downloads without problems. How can I implement a file download in a mobile application?

       <q-btn class="button blue-btn" @click="getPDF">Download</q-btn>
      
      getPDF: function () {
            html2canvas(document.querySelector('#ticket'))
              .then((canvas) => {
                let doc = new JSPDF('l', 'mm', 'a4')
                doc.addImage(canvas.toDataURL(''), 'JPG', 0, 0, 300, 250)
                let fileName = ` ${moment(this.readings.date).format('DD MM YYYY')}.pdf`
                doc.save(fileName)
              })
              .then(async () => {
                let email = this.getEmail.email
                console.log('my em:', email)
                this.$store.dispatch('send-pdf/create', { query: { email: email } })
              })
              .catch((e) => {
                console.log('errrrror:', e)
              })
          },
      
      1 Reply Last reply Reply Quote 0
      • lucasfernog
        lucasfernog last edited by

        I believe you should ask this on JSPDF help platform

        1 Reply Last reply Reply Quote 0
        • L
          lmarcelo last edited by

          a favor did you manage to solve the pdf download in the mobile app, if you could help me

          1 Reply Last reply Reply Quote 0
          • First post
            Last post