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

How to disable previous pdf loaded from blob #90

Closed
falcon1029 opened this issue May 12, 2020 · 1 comment
Closed

How to disable previous pdf loaded from blob #90

falcon1029 opened this issue May 12, 2020 · 1 comment

Comments

@falcon1029
Copy link

falcon1029 commented May 12, 2020

everytime i view the pdf viewer it always display the previously loaded pdf .

this.downloadFile(this.pdfSr1c).subscribe(
      (res) => {
    
        this.pdfViewerAutoLoad.pdfSrc = res; // pdfSrc can be Blob or Uint8Array
        this.pdfViewerAutoLoad.refresh();
        this.pdfViewerAutoLoad.refresh();
        this.pdfViewerAutoLoad.refresh(); // Ask pdf viewer to load/refresh pdf
      }
    );

 private downloadFile(url: string): any {
    return this.httpclient.get(url, {observe: 'body', responseType: 'blob' as 'json'})
      .pipe(
        map((result: any) => {
          console.log(result);
          return result;
        })
      );
  }
@beazergood
Copy link

@roxic8 how did you fix this? I currently have the same issue. I change the src of the pdf by clicking on a thumbnail in my application but the viewer is always displaying the previous pdf.

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

2 participants