Giter Site home page Giter Site logo

Comments (7)

justinjung04 avatar justinjung04 commented on August 24, 2024

We tried loading a XOD file with 600+ pages, but we weren't able to reproduce SET_TOTAL_PAGES being triggered multiple times. We also dispatch the action in three event listeners only:

  • onBeforeDocument: to get total pages from metadata
  • onDocumentUnloaded: to set total pages to 0
  • onLayoutChanged: the event name's misleading, but this event gets triggered when pages have permanently been added or removed.

Could you provide more information to help us debug the issue?

from webviewer-ui.

justinjung04 avatar justinjung04 commented on August 24, 2024

We also tried loading linearized PDF with 600+ pages, but SET_TOTAL_PAGES was triggered only once.
image

from webviewer-ui.

henry-chris avatar henry-chris commented on August 24, 2024

from webviewer-ui.

henry-chris avatar henry-chris commented on August 24, 2024

from webviewer-ui.

henry-chris avatar henry-chris commented on August 24, 2024

After we upgraded and merged to 4.0.2_68331 version.

Example of problem with PDF -
image

Note that the 'SET_TOTAL_PAGES' happens a LOT more after the picture. Probably one for every partial content download (but I haven't verified this).

PDF can be found here: https://pdfmarkupblobstore.blob.core.windows.net/sample-container/ZierdtRdPhase4.pdf

from webviewer-ui.

henry-chris avatar henry-chris commented on August 24, 2024

Oh, I missed something from your previous message, sorry.

It's definitely onLayoutChanged.js:
image

Put a breakpoint in all 3 places. It hits 'onBeforeDocumentLoaded' first (once), then hits the 'onLayoutChanged' every other time (a lot).

If I trace this back, I come first to this function in your minified CoreControls (let me know if you'd prefer me to not post these):
image

And the Call Stack:
image

I formatted CoreControls inside the Chrome debugger. CoreControls should be this version - 4.0.2_68331. Hopefully this helps.

from webviewer-ui.

ZhijieZhang avatar ZhijieZhang commented on August 24, 2024

LayoutChanged event will be triggered when there are pages added, deleted, moved(index of a page changed) or content has changed. When we are downloading linearized PDF, pages will be updated and this event will be triggered. SET_TOTAL_PAGES should be dispatched once in the beginning and not be dispatched in the subsequent page updates. We will fix it and merge to master soon.

from webviewer-ui.

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.