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

Document loaded but the pages keep on showing the loading animation #201

Closed
dafooz opened this issue Nov 8, 2017 · 6 comments
Closed

Document loaded but the pages keep on showing the loading animation #201

dafooz opened this issue Nov 8, 2017 · 6 comments

Comments

@dafooz
Copy link

dafooz commented Nov 8, 2017

Hi,

I installed and used the package as stated on the page. It seems to work as it's loading the PDF (I checked by adding the after-load-complete event and it get's reached properly) the number of pages is correct and the display is correct as well... My only issue is that instead of showing the content of the pages, it shows a loader on each of them and it never goes away...

EDIT: This seem to be the case only in a specific component of my application. If I try the same code in the main component, it works fine...

In the main component, the pages have the attribute data-loaded=true while in my other component, that attribute isn't there...

Can you please help?

package.json:

"dependencies": {
    "@angular/animations": "^4.2.4",
    "@angular/common": "^4.2.4",
    "@angular/compiler": "^4.2.4",
    "@angular/core": "^4.2.4",
    "@angular/forms": "^4.2.4",
    "@angular/http": "^4.2.4",
    "@angular/platform-browser": "^4.2.4",
    "@angular/platform-browser-dynamic": "^4.2.4",
    "@angular/router": "^4.2.4",
    "@ngrx/store": "^4.1.0",
    "ng2-pdf-viewer": "^3.0.0",
    "rxjs": "^5.4.2",
    "zone.js": "^0.8.14"
  },

code in template:
<pdf-viewer [src]="itemInfo.doc" [render-text]="true" style="display: block;" [original-size]="false" [autoresize]="true" (error)="onPDFError($event)"></pdf-viewer>

Thanks a lot in advance for your help,
Regards,
Dafooz

@dafooz
Copy link
Author

dafooz commented Jul 26, 2018

Hi @Blustch,
I know I made it work but I don't remember how... I will try to check the code and come back to you asap.

@Blustch
Copy link

Blustch commented Jul 26, 2018

Hi again @dafooz,
Sorry, deleted my previous comment because I posted it before even checking out the linked references ( which was lazy of me). I will also come back to you if I find anything new.

@MRisto-zz
Copy link

Any updates on this? Have the same Problem. Strange is, that this problem occurs for me in a material dialog.

@chris2ba
Copy link

Bump I'm having the same issue here.

@Blustch
Copy link

Blustch commented Aug 28, 2018

For me, the problem occurs in a material sidenav, and weirdly enough only on Chrome.
Just to give some context, I am displaying 2 PDFs (one under the other), both of one page each. The issue only affects the bottom PDF which is not displayed immediately (ie: you have to scroll to see it). It eventually appears after a random number of refreshs.

The end-users of my web-app mainly use Edge or Firefox (where it displays just fine) so in the end, there was no need for me to try to fix it. It's not the only issue I have with Chrome, so I'm slowly moving away with it.

@RamaKrishnanGanesan
Copy link

Facing the same issue in my angular 6 application. The pdf downloads fine (able to see in the browser's network traffic). Seeing loading gif in the DOM for each page of the pdf. The DOM for the pdf page is not getting generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants