intbot / ng2-pdfjs-viewer

An angular component for PDFJS and ViewerJS (Supports all versions of angular)
Apache License 2.0
225 stars 113 forks source link

Getting Invalid or Corrupted Pdf File only sometimes using Blob or Unit8Array as source #215

Open Satyabrata-Pal1 opened 1 year ago

Satyabrata-Pal1 commented 1 year ago

Usage is as follows ngAfterViewInit(){ this.PdfViewer.pdfSrc = this.url; this.PdfViewer.refresh(); } ngOnChanges() { if(refreshRequired){ this.PdfViewer.pdfSrc = this.url; this.PdfViewer.refresh(); } }

Thing is the pdf loads fine most of the time, but sometimes it gives the error - Invalid Pdf Structure On checking the get request for the blob , it returns 200Ok But the response has a Html page and the pdf does not load. What is the solution to this?

codehippie1 commented 1 month ago

@Satyabrata-Pal1 Could you create a mini repo where I can reproduce this issue ?