Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to not load first page initially #28

Closed
gloriajsf opened this issue Nov 22, 2016 · 2 comments
Closed

Is it possible to not load first page initially #28

gloriajsf opened this issue Nov 22, 2016 · 2 comments
Assignees
Milestone

Comments

@gloriajsf
Copy link

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?

@nessgor
Copy link

nessgor commented Nov 22, 2016

@gloriajsf For the problem about callback function,
try place this in the constructor:

this.loadComplete = this.loadComplete.bind(this);

@gloriajsf
Copy link
Author

Worked! Thank you!

@VadimDez VadimDez self-assigned this Nov 22, 2016
@VadimDez VadimDez added this to the 0.1.2 milestone Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants