Page changing issue when binding to page attribute
See original GitHub issueWhen you bind to the page
attribute with both a getter and setter like [(page)]
the scrolling inside the PDF breaks and jumps to the page beginning whenever you come close to the new page on scrolling.
I tried to circumvent this behavior by not using this kind of binding but (pageChange)
event instead. This works like using a (page)
binding but I also want to be able to set the page number from the outside. Using [page]
results in the same problem as described above because when the page change event is triggered on half on the scroll view of the new page, the page will jump to the new page. This prohibits smooth page scrolling.
I then tried to set the page attribute by ViewChild binding the ngx-extended-pdf-viewer component and setting the page like this:
@ViewChild('pdfComponent') private pdfComponent: NgxExtendedPdfViewerComponent;
...
this.pdfComponent.page = newPageNumber;
But this doesn’t affect any changes. It would be cool to have a setter that enables to set the PDF.js PDFViewerApplication.page
attribute in order to change the page.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Great! If I read your source code correctly, my idea was almost successful. That gives me hope I can solve the problem in the library itself.
Thanks for the hint!
After publishing version 4.0.5, the bug should be gone. For some reason, it’s not possible to use both
[(page)]
and[(pageLabel)]
at the same time. I’ve documented this in the showcase.