Support for PDF hot reload in PDF.js
This commit is contained in:
parent
2f3463d5d5
commit
712598b94c
1 changed files with 9 additions and 0 deletions
9
resources/js/clients/shared/pdf.js
vendored
9
resources/js/clients/shared/pdf.js
vendored
|
|
@ -80,6 +80,15 @@ class PDF {
|
|||
.getElementById('zoom-out')
|
||||
.addEventListener('click', () => this.handleZoomChange());
|
||||
|
||||
document
|
||||
.querySelector('meta[name=pdf-url]')
|
||||
.addEventListener('change', () => {
|
||||
this.canvas.getContext('2d').clearRect(0, 0, this.canvas.width, this.canvas.height);
|
||||
this.url = document.querySelector("meta[name='pdf-url']").content;
|
||||
|
||||
this.handle();
|
||||
})
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue