Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: Version 5.2 Broke (page-rendered) #408

Closed
Warriormuffin opened this issue Nov 6, 2018 · 7 comments · Fixed by #465
Closed

Regression: Version 5.2 Broke (page-rendered) #408

Warriormuffin opened this issue Nov 6, 2018 · 7 comments · Fixed by #465
Labels
Milestone

Comments

@Warriormuffin
Copy link

Bug Report or Feature Request (mark with an x)
- [X] Regression (a behavior that used to work and stopped working in a new release)
- [ ] Bug report -> please search issues before submitting
- [ ] Feature request
- [ ] Documentation issue or request

The docs state

"Get event when a page is rendered. Called for every page rendered."

This used to be the case but no longer functions that way. Now if you use [page]='pdfPageNumber' to increment the page number this callback is never recalled.

@VadimDez
Copy link
Owner

VadimDez commented Nov 7, 2018

(page-rendered) is working when [show-all] is true but not when [show-all] is false
Tested here: https://vadimdez.github.io/ng2-pdf-viewer/

@Warriormuffin
Copy link
Author

So we will no longer be able to use [show-all]='false' and page-rendered to capture each page of the pdf individually?

@VadimDez
Copy link
Owner

I've just tried in the latest version and it seems to be working. When you set [show-all]="false" (page-rendered) is called on the first render but not the second. Not sure if that covers your use case. Otherwise you could use something like this:

window.addEventListener('pagechange', (e) => console.log(e));

@Warriormuffin
Copy link
Author

That is not how it worked one version ago though. Was there a reason it needed to change? Before (page-rendered) would be called everytime a new pdf page was loaded into the pdf viewer. Now that functionality has stopped working when you have [show-all]="false"

@VadimDez
Copy link
Owner

There were several changes related to how single page is rendered. PDFSinglePageViewer and custom event bus are now used.

@VadimDez VadimDez added the bug label Nov 20, 2018
@VadimDez VadimDez added this to the 5.2.4 milestone Dec 8, 2018
@thomas-ama
Copy link

Same issue for (text-layer-rendered) as it is triggered in the same way as (page-rendered).

For those who would like to test...
Here is a stackblitz where page-rendered and text-layer-rendered events are console logged.
Load a local PDF then click several times on the Next page button.
Events are not triggered at each page change.

https://stackblitz.com/edit/ng2-pdf-viewer-q3tiib

@sChupin
Copy link

sChupin commented Apr 11, 2019

The (page-rendered) event is correctly triggered but the (text-layer-rendered) not is still not triggered on page change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants