Giter VIP home page Giter VIP logo

Comments (5)

hurkanyakay avatar hurkanyakay commented on June 12, 2024

I also faced that problem.Any ideas?

from vue-pdf.

FossPrime avatar FossPrime commented on June 12, 2024

@hurkanyakay Workaround: debounce or throttle... Ideally one would be able to go as fast as possible.

  setPage: debounce(
      function (page) { // vue-pdf breaks if flipping 1 -> ~30 / 40
        let validated = page <= this.numPages && page >= 1 ? page : this.page
        this.page = validated
        this.fakePage = validated
      }, 100)

from vue-pdf.

FossPrime avatar FossPrime commented on June 12, 2024

@hurkanyakay 3.1 clearly fixed this, It now generates these good errors:

RenderingCancelledException {message: "Rendering cancelled, page 9", type: "canvas"}

from vue-pdf.

FossPrime avatar FossPrime commented on June 12, 2024

Strangely, it seems somewhat fine in the simplest case going forward with 3.1, not when going backward however. In my production pdf it breaks on page 25+ going forward.

with a range it's easier to see:

Error: Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.
    at InternalRenderTask_initializeGraphics [as initializeGraphics] (api.js:2227)
    at api.js:894
    at <anonymous>

https://fiddle.jshell.net/fossfiddler/5k4ptmqg/149/
gonzales

The 100ms debounce workaround still works.

from vue-pdf.

FranckFreiburger avatar FranckFreiburger commented on June 12, 2024

I understand that a debouncing could fix the issue, but I need to find a more robust fix, I think it's just a canvas access synchronisation issue ...

from vue-pdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.