I’m using angular 2.0.0 and would like to load a page of a pdf file on any possible page number. It doesn’t take the [page] input till the pdf is loaded and displayed. I used setTimeout to delay the event of reassigning the page number to [page] by 1 second, and it works.
But the pdf viewer still displays first page initially and goes to that page 1 second later, which is not so ideal.
Another attempt tried is the call back function
[after-load-complete]="loadComplete", but in
loadComplete function the scope of the object is lost and
this was referring to the ng2-pdf-viewer library, instead of the Component object. So it’s not possible to reassign page there either.
Is the feature of ng2-pdf-viewer to allow only first page load initially? Is there a better solution if I want to load any page initially by using this?