Open kempsteven opened 3 years ago
Looking at the code the progress tracking definitely seems to be a work-in-progress. I wasn't able to yield any helpful results.
It appears that you need to use this.progress
in one of the Worker API methods
.
In my testing I didn't see this.progress
change significantly.
Here is what I used to test it:
new html2pdf.Worker()
.then(function() {
let numIterations = 40
const interval = setInterval(() => {
if (numIterations <= 0) {
clearInterval(interval)
return
}
numIterations -= 1
console.log(this.progress)
}, 100)
})
...
You mentioned here, that the Worker object returned by html2pdf() has a built-in progress-tracking mechanism.
How exactly do we get the progress?