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

pdf viewer unable to load pdf from blob url some times #364

Closed
sekh09 opened this issue Aug 16, 2018 · 6 comments
Closed

pdf viewer unable to load pdf from blob url some times #364

sekh09 opened this issue Aug 16, 2018 · 6 comments
Labels

Comments

@sekh09
Copy link

sekh09 commented Aug 16, 2018

Hi @VadimDez ,
Nice plugin to use..
But have few issues while previewing the pdf in a modal pop up.. some times (2 out of 10 attemps) its just showing loading icon even we provided the blob Url

usage:
<pdf-viewer [src]="data.pdfUrl" [render-text]="true" [original-size]="true" [zoom]="1.0" style="display: block;">

the pdfUrl we are passing is blob:http://:8080/2df9ff10-67b7-4771-b388-62b12c0541b7

any help on this is really useful for me..

The version I am using is 5.1.0.

Few more observations afterLoadComplete callbackFn is success but neither pageRendered or onError functions are not even fired.

Thanks.

@maxime1992
Copy link

Has anyone found a workaround for that? I'm having the exact same issue currently that'd be really helpful

@avssolutions
Copy link

Did someone find good solution for this, i am having same problems :(

@johnbrittoa
Copy link

same issue for me

@AcarMeel
Copy link

AcarMeel commented Feb 5, 2020

I'm having the same issue. Angular 6. I get a blob file from an API and I convert the blob to URL and is not rendered.
let blobFile = new Blob([data], { type: 'application/pdf' });
let blobUrl = URL.createObjectURL(blobFile);

@lanminik
Copy link

lanminik commented Mar 25, 2020

Hi guys, I had the same issue (pdf in a modal) and it was showing infinitive spinners until refresh the page. I fixed that with setting 'src' variable to null every time before fetching a new Blob from my API. So my code looks something like this:
<pdf-viewer *ngIf="!!pdfSrc"
[src]="pdfSrc"
[render-text]="true"
[fit-to-page]="true"
style="display: block;"
>

this.authenticationService.loggedUser$.subscribe((user) => {
  this.pdfSrc = null;

  if (user) {
    this.helpService.getHelp().subscribe(data => {
      this.pdfSrc = new Uint8Array(data);
    });
  }
});

Using Angular 9...
Glad if it helps somebody...

@stale
Copy link

stale bot commented Jul 31, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 31, 2020
@stale stale bot closed this as completed Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants