ngx-extended-pdf-viewer not loading pdf if opens that component after some time of page refresh

3.2k Views Asked by At

For pdf viewer in angular, I am using ngx-extended-pdf-viewer: 10.0.0-alpha.8 I am using that pdf in one of the components (PDFViewerComponent), If I open that component after project start/page refresh it works perfectly. But when I open another component and after 1/2 mins navigate to PDFViewerComponent then it shows like this: enter image description here

And there are no errors on the console regarding this. Thanks..

1

There are 1 best solutions below

0
On

Had the same problem and I solved it by adding an *ngif to the viewer to view it only if the pdf was loaded.

<ngx-extended-pdf-viewer *ngIf="provisionService.displayPdfDialog"
                             [src]="provisionService.pdfFile"
                             [useBrowserLocale]="true"
                             [minifiedJSLibraries]="false">
</ngx-extended-pdf-viewer>