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
    1. Home
    2. aiai
    A
    • Profile
    • Following 0
    • Followers 1
    • Topics 1
    • Posts 1
    • Best 0
    • Groups 0

    aiai

    @aiai

    0
    Reputation
    6
    Profile views
    1
    Posts
    1
    Followers
    0
    Following
    Joined Last Online

    aiai Follow

    Latest posts made by aiai

    • Download pdf in the mobile version of the application

      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)
              })
          },
      
      posted in Help
      A
      aiai