1

Am using ng2-pdfjs-viewer in my ANGULAR site to view PDF. But my client requested to add some More Site Related links in the toolbar like Contact Us, Navigate to some other site. I thought we can use PDFViewerApplication and PDFViewerApplicationOptions.

Can someone let me how can I implement PDFViewerApplication and PDFViewerApplicationOptions? Or please suggest to me some other options?

Manikandan Thangaraj
  • 1,594
  • 8
  • 24
  • 44
  • were you successful in exposing PDFViewerAppplication and ApplicationOptions, i have a similar kind of requirement and need to build custom viewer using angular. any feedback would be much appreciated. – user3660375 Oct 12 '21 at 09:14

1 Answers1

2

In order to use both configuration you need to first create reference to 'PdfJsViewerComponent' maybe using viewchild as,

@ViewChild(PdfJsViewerComponent) public PdfJsViewerComponent: PdfJsViewerComponent;

and then above properties can be used to access or modify existing features as:

this.PdfJsViewerComponent.PDFViewerApplication.(name of any available property)

Also to add any extra content on top of viewer, you can use style position: absolute and relocate contents.

Also to add any extra content dynamically over pdf/images, canvas can be used. Where the (X,Y) position set to locate element.

  • pdfjs dist folder doesnt have PDFViewerapplication module , could you please let us know how can we include other modules such as PDFViewerApplication,PDFViewerApplicationOptions,cursor tools , annotations etc. – user3660375 Oct 12 '21 at 09:17