ngx-extended-pdf-viewer Is it possible to render only one page?

Viewed 3420

I am using ngx-extended-pdf-viewer in Angular 8, the pdf shows up correctly. My problem is that i only need to show a single page but by default it shows all the pages.

Is there a way to render only one page with this pdf viewer ?

here is my code

<ngx-extended-pdf-viewer 

      [src]="pdfSrc" 
      [handTool]="true"
      [showHandToolButton]="true"
      backgroundColor="#ffffff"
      [height]="'100vh'"
      [useBrowserLocale]="true"
      [zoom]= 73
      [showSidebarButton]="false"
      [showFindButton]="false"
      [showPagingButtons]="false"
      [showZoomButtons]="false"
      [showPresentationModeButton]="false"
      [showOpenFileButton]="false"
      [showPrintButton]="false"
      [showDownloadButton]="false"
      [showBookmarkButton]="false"
      [showSecondaryToolbarButton]="false"
      [showRotateButton]="false"
      [showHandToolButton]="false"
      [showScrollingButton]="false"
      [showSpreadButton]="false"
      [showPropertiesButton]="false"
      [sidebarVisible]="false"

></ngx-extended-pdf-viewer
4 Answers

Have you read the documentation ?

[(page)] → two-way binding attribute to determine the page to display; more precisely: [page]="25" makes the PDF viewer show page 25 (at any time - even after load time); [(page)]="attribute" updates the attribute each time the user scrolls to another page. If you're only interested in the event, that's (pageChange).

I'm the developer of ngx-extended-pdf-viewer. No, currently it's not possible to render a single page only. I've created the component to bring the complete feature set of the good old Adobe reader to the Angular world. It's about reading entire documents in style.

To display individual page, I recomment two other approaches:

  • Use the PDF widget of Vadym Yatsyuk. This guy has created an impressive widget, so it may be your friend. However, it's still optimized for displaying entire documents.

  • The pdf.js project page has examples how to render individual pages. That's a low-level API, but as far as I can see, the documentation is good.

Related