Ng2-pdf-viewer: Page is not working

Created on 26 Oct 2018  Â·  10Comments  Â·  Source: VadimDez/ng2-pdf-viewer

Bug Report or Feature Request (mark with an x)
- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [ x] Bug report -> please search issues before submitting
- [ ] Feature request
- [ ] Documentation issue or request

Hello, I'm using version 5.2.0 and I'm not able to make the [page] working. I'm using it with the right [show-all]. I tried [page] and also the [(page)] but it does nothing. I don't have any error in the console but page is always the first one.

bug

All 10 comments

I am seeing the same thing with 5.2.0 during my development. I am finding that when a page number is specified as an attribute of the pdf-viewer tag, page one is always displayed. If I set page to a variable within my angular component, the page variable that I have specified needs to be set at handling of the page-rendered event. If the value is set before that event has fired, the value has no impact on what page is rendered. For example the following tag specification always shows page 1 for the 4 page document that I am providing as src:

[src] ="pdfSrc"
[page]="2"
[show-all]="false"
[render-text]="true"
[autoresize]="true"
[original-size]="false"
style="display: block;"
>

If the literal 2 is replaced with a variable that has been initialized at definition, the page that is displayed is page 1. For an earlier project that uses version 5.1.2, the initialized variable works but the literal value in the attribute does not.

It is my impression that the change in the value of the page property is being handled but any initial value is ignored.

Sorry. I went back and checked my app that uses version 5.1.2 and the literal value for the [page] attribute works fine. For me it is version 5.2.0 where it fails.

Can confirm, this is working in 5.1.3 and not in 5.2 anymore. Had to revert the version because of this.

+1

Fixed in 5.2.3

maybe i'm doing something wrong, but not working for me. [(page)] works alone, but not combined with [show-all]="true" and [stick-to-page]="true"

Fixed in 5.2.3
@VadimDez

Could you confirm this?
Because its not working for me in 5.2.3

@liaothomas When I scroll through pages it doesn't get updated

Hi All,
when i am scrolling the pages showing blank only in Pixel 3 chrome 72

Well my problem was that it was indexed with the first page as 1 and not 0.

Was this page helpful?
0 / 5 - 0 ratings