1

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..

Stephan Rauh
  • 3,069
  • 2
  • 18
  • 37
Shubham
  • 125
  • 1
  • 9
  • How does it show normally? – Apoorva Chikara Aug 27 '21 at 06:49
  • Normally it works like the example shown on this link: https://pdfviewer.net/extended-pdf-viewer/simple. – Shubham Aug 27 '21 at 07:36
  • Have you checked the data passing to the pdf component when you go back? – Apoorva Chikara Aug 27 '21 at 08:21
  • Data passing is correct because other things on the component are working properly like data is getting filled in inputs except for pdf. (data is fetched from BE from ngOnInit() ) – Shubham Aug 27 '21 at 09:21
  • If you're able to send me a reproducer, please open a bug ticket at https://github.com/stephanrauh/ngx-extended-pdf-viewer/issues. – Stephan Rauh Sep 10 '21 at 19:58
  • got exactly the same issue but when using book mode. it doesn't render the right hand side page . if I do a full page refresh it works fine. (apart from the initial load) – Intrigue Feb 18 '22 at 02:24

1 Answers1

1

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>
Ralf
  • 43
  • 9