vue-pdf icon indicating copy to clipboard operation
vue-pdf copied to clipboard

Question:when did the pdf finish rendering ?

Open Chris-DF opened this issue 4 years ago • 1 comments

I have a v-if directive for destroy the pdf component., and refresh it. buttonOpen1 @click="disp", buttonOpen2 @click="disp", buttonOpen3 @click="disp", btnClose @click="closeDialog"

<dialog>
<v-flex v-if="reloaded">
<pdf v-for="i in numPages"
            :key="i"
            :src="pdfSrc"
            @progress="loadedRatio = $event"
            :page="i"></pdf>
      </v-card-text>
</flex>
</dialog>
method: 
disp : fuction(){
  this.pdfSrc = filePath +filename
        pdf.createLoadingTask({ url: this.pdfSrc, CMapReaderFactory }).then(
          (pdf) => {
            this.numPages = pdf.numPages
            this.reloaded=true
          }
        )
}
closeDialog : fuction(){
  this.reloaded=false
  ...
}

When I clicked btnClose a little faster, next time, btnOpen1 will get a whole white blank dialog page. So could you help me for this question. How can I know when all of pages of the pdf are rendered completely. Is there a event I could use for ? Thank you.

Chris-DF avatar Apr 15 '20 17:04 Chris-DF

怎么解决呢 我也遇到此问题

zoubeihua avatar Jul 14 '21 09:07 zoubeihua