1 possible answer(s) on “How to scroll to page?

  1. Now you can scroll to a page with the following code, add this to your component that uses pdf-viewer component

    // define view child
    @ViewChild(PdfViewerComponent) private pdfComponent: PdfViewerComponent;
    
    // ...
    
    scrollToPage(page: number) {
      this.pdfComponent.pdfViewer.scrollPageIntoView({
        pageNumber: page
      });
    }

    and then use it

    scrollToPage(3);