Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140762

How to print(download as pdf ) multiple QR codes in a single web-page using vuejs and jspdf

$
0
0
Part of my academic project i need to produce multiple QR code for Tickets(pass). I already generate tickets using vuejs but it can't be printed. After using jspdf code the Qr code is not printing in that pdf file. What i do for downloading that multiple QR codes in a single file.

//QR code Generation//

Multiple QR code generated but it cant be Download as PDF(It is not displayed in PDF file)

< div>
           <label for="num">Enter the ticket count  </label>
             <div ref="content">
               <input v-model.number="count"  step="1" placeholder="No of tickets  ">
                 <h3>QR CODE</h3>
                   <table id="table">
                     <tr>
                       <td v-for="n in count" :key="n">
                       <qrcode-vue :value="values.value+n" :size="values.size" level="H">
                       <div class="sizee">
                       {{values.value+n}}
                      </div>
                    </qrcode-vue>
                  </td>
                </tr>
              </table>
               </div>
              <button @click="download()">Download PDF</button>
            </div>

        //Download as pdf sing jspdf

        download() {
          const doc = new jsPDF();
          const contentHtml = this.$refs.content.innerHTML;
          doc.fromHTML(contentHtml, 15, 15, {
            width: 170
          });
          doc.save("sample.pdf");
         },

//image

In that screenshort shows the problem. QR code generate properly and i can add different values.. but after clicking the download PDF button QR code not displayed in PDF file.

       https://ibb.co/fFxmdd0
       https://i.stack.imgur.com/B9CuD.png

Viewing all articles
Browse latest Browse all 140762

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>