ng2-pdfjs-viewer icon indicating copy to clipboard operation
ng2-pdfjs-viewer copied to clipboard

nameddest is not working with a reference variable - data binding

Open ishanuda opened this issue 5 years ago • 3 comments

Hi, Thanks for the amazing library.

I would like to know about the nameddest

I tried to set the nameddest using a variable, and when I change the variable dynamically, the page does not scroll to the destination.

Note: When loading the first time with setting the nameddest variable, The page scrolls the PDF to the destination.

I think it is not supporting data binding or is it? or Am I using the nameddest wrong way?

Feature request: If it is not supporting data binding, Can you make this to bind a variable and act accordingly when changing the variable dynamically?

Tested on

Angualar 8 "ng2-pdfjs-viewer": "^5.0.5",

Thank you very much

ishanuda avatar Jan 25 '20 19:01 ishanuda

@ishanuda As you could see, I have exposed PDFViewerApplication object and its options. This can be used to access internal methods to work with pdf directly.

For example PDFViewerApplication .PDFLinkService.navigateTo() method can be used to navigate the document with nameddest as a parameter.

Please check the code inside viewer.js to see how this function works in case you are interested.

codehippie1 avatar Jan 27 '20 17:01 codehippie1

Hi, Thank you for the quick reply and the information.

As you suggest I will try with the given solution, But I would love to see the library supporting the feature so that anyone can use the library without accessing the PDFjs internal API directly.

Regards

ishanuda avatar Jan 27 '20 19:01 ishanuda

@ishanuda I would love to add as many features as possible. Since, This is a single author project and I am allocating most of my time in upgrades and bug fixes and implementing features requested by more than one user. If you would like to contribute to the project, let me know, I would be glad to get some help. :-)

codehippie1 avatar Feb 18 '20 17:02 codehippie1