x)- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [X ] Bug report -> please search issues before submitting
- [ ] Feature request
- [ ] Documentation issue or request
Every time I change a page, it automatically scroll to the begining document. Is there any way to disable it?
Here is my code:
<pdf-viewer [src]="pdfObj.url"
[show-all]="false"
[stick-to-page]="flase"
[(page)]="currentPDFPage"
[original-size]="false"
style="display: block;"
[rotation]="rotation"
[zoom]="zoom"
(error)="onError($event)"
(after-load-complete)="afterLoadComplete($event)">
</pdf-viewer>
I want to know how to solve that issue too.
You can don't set the [page] by removing [(page)]="currentPDFPage"?
Hi, same issue for me, any news about this problem ?
Also an issue for me. If I am navigating from page to page, my Next and Previous button move out of the visible screen when it snaps to the viewer.
Please anybody have a solution for this issue.
Is very unconfortable and if you ut some logos in the head of the page hide them.
This scroll must be an optional feature in properties and no forced always
Fixed in 6.0.0 See https://github.com/VadimDez/ng2-pdf-viewer/blob/master/CHANGELOG.md#600
Hey there! I still have this problem. How I suppose to disable the scroll on top when page changes? Using [stick-to-page]="false"? I can't make it work..
As workaround, for now I've commented this portion of code
_get(_getPrototypeOf(PDFSinglePageViewer.prototype), "_scrollIntoView", this).call(this, {
pageDiv: pageDiv,
pageSpot: pageSpot,
pageNumber: pageNumber
});
in node_modules/pdfjs-dist/web/pdf_viewer.js (Ln 6336)
I have found a workaround that doesn't involve directly changing the pdfjs module. So what you need to do is to capture on your component the PdfViewerComponent. Then you can access the pdfviewer and inside there is an object call scroll.down and you can set it to false. And that's it you will no longer have scrolling when changing pages.
Angular Component
```
@ViewChild(PdfViewerComponent, { static: false })
private pdfComponent: PdfViewerComponent;
initLoadCompleted(pdf: PDFDocumentProxy): void {
this.pdfComponent.pdfViewer.scroll.down = false;
}
**HTML**
[render-text]="true"
[page]="currentPage"
[show-all]="false">
```
Most helpful comment
Hey there! I still have this problem. How I suppose to disable the scroll on top when page changes? Using
[stick-to-page]="false"? I can't make it work..As workaround, for now I've commented this portion of code
in
node_modules/pdfjs-dist/web/pdf_viewer.js(Ln 6336)