question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'textlayerrendered' event not alway fired when added by document.addEventListener

See original GitHub issue

I have a code in my project like below:

document.addEventListener('textlayerrendered', function (e) {
  var pageIndex = e.detail.pageNumber - 1;
  var pageView = PDFViewerApplication.pdfViewer.getPageView(pageIndex);
  console.log('text rendered', pageView );
  [ below is my logic ]
}, true);

But problem is textlayerrendered not alway fired, some times there’s no CONSOLE output; and [my logic] part don’t work at all, and no error reported in console. But after a fresh(F5), the event fired with no problem;

It’s hard to catch, about 2-5% chance to encounter this; Please confirm whether some thing went buggy? or it’s the problem of my network?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
diwakar1911commented, Feb 22, 2019

set “eventBusDispatchToDOM”: true in viewer.js why isn’t anyone telling this!

0reactions
timvandermeijcommented, Sep 4, 2016

The provided JSBin is just the regular viewer in an iframe, so this does not display the problem. Since this issue was opened, there has been refactoring of the viewer events. Closing as incomplete until a clear example is provided that shows the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

addEventListener drop not firing - Stack Overflow
getEventListeners(document.getElementById('sub-main'));. But the drop event still does not fire. Any ideas?
Read more >
JavaScript Event Listeners Ultimate Guide
The removeEventListener function is a simple function that you can call on an element to remove an event listener that was previously added...
Read more >
viewer.js.map
initialRotation;\n }\n\n // Always let the browser history/document hash take ... into the browser history when the 'unload' event has already fired).
Read more >
pdfjs-dist - UNPKG
n printing_not_ready: \"Warning: The PDF is not fully loaded for printing. ... an action always occurs, even when an event\n * arrives late...
Read more >
Falcon Sandbox v8.30 © Hybrid Analysis
Not all malicious and suspicious indicators are displayed. Get your own cloud service or the full version to view all details.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found