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

(page-rendered)="pdfPageRendered2($event)" event is not working as expected with angular 16.2.12 & ng2-pdf-viewer v^9.1.5 #1100

Open
sikindargithub opened this issue May 17, 2024 · 1 comment

Comments

@sikindargithub
Copy link

sikindargithub commented May 17, 2024

Regression (a behavior that used to work and stopped working in a new release)
Hi @VadimDez ,
Earlier I am using angular 12.2.10 with ng2-pdf-viewer v^6.4.1, but when I upgraded to angular 16, I used ng2-pdf-viewer v^9.1.5
along with pdfjs-dist v^2.16.105, with this (page-rendered)="pdfPageRendered2($event)" is not working as expected, could any one pls suggest me what are the compatible versions of ng2-pdf-viewer & pdfjs-dist for angular 16.2.12 version.

@namaralsag
Copy link

Hi
I am also facing an issue with (page-rendered)="pdfPageRendered($event)"
I upgraded from angular 15 to 16 and ng2-pdf-viewer from 6.3.2 to 10.3.1.

The (page-rendered) is now triggered 2 times at the start and the first time it seems that the pdf is not fully rendered when the output page-rendered is triggered. The 6.3.2 version only triggered it once.

In the function pdfPageRendered(event) some properties are not updated. It's really specific but when i'm looking at event.source.viewport (for example the width, depending on the size of your pdf and if the viewer has to resize, changes between the first call and the second).
If I put a timeout of 1ms before logging the width, it will have it's correct/final value.

I'm currently using the RenderingQueue from the event event.source.renderingQueue.pdfViewer.eventBus.on('pagerendered',... to obtain correct values at the end.

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

No branches or pull requests

2 participants