stephanrauh / ngx-extended-pdf-viewer

A full-blown PDF viewer for Angular 16, 17, and beyond
https://pdfviewer.net
Apache License 2.0
449 stars 167 forks source link

Ngx Extended Pdf Viewer 404 (Not Found) #2358

Open Valma-EG opened 3 weeks ago

Valma-EG commented 3 weeks ago

I need some help

image My pdf viewer is no more working on local giving me this error. I've tried to solve it but I'm blocked and I don't know how to go on.

this is my html:

<div class="pdf-viewer">
    <ngx-extended-pdf-viewer 
        *ngIf="pdfSrc"
        [src]="pdfSrc" 
        [formData]="form?.value" 
        [textLayer]="true"
        (formDataChange)="formDataChanged($event)" 
        [disableForms]="disableAcroForms" 
        (pageRendered)="setupForm()"
        useBrowserLocale="true" 
        height="100vh">
    </ngx-extended-pdf-viewer>
</div>

where: pdfSrc = 'assets/bu830-31.pdf';

Version info Agular 17 "ngx-extended-pdf-viewer": "^19.7.1"

B34v0n commented 3 weeks ago

I got the exact same error with Angular 17.3.10 and ngx-extended-pdf-viewer version 20.0.2

B34v0n commented 3 weeks ago

I even tried updating the viewer to 20.2.0, but it didn't help. I recently updated angular from 17.3.0 to 17.3.10 and the viewer from 19.7.1 to 20.0.2. Before I did that update, everything worked fine, so I tried to go back to these Versions, but I still got the error.

stephanrauh commented 3 weeks ago

At the moment, I'm also confused. I decided to remove the minified ES5 versions of the files some time ago, but when I did, I also made sure these files aren't requested. Appearently, this didn't work.

While I'm still trying to figure it out, I suppose you can solve the issue by adding the attribute [minifiedJSLibraries]="false" to the <ngx-extended-pdf-viewer> tag.

Valma-EG commented 3 weeks ago

Ok, thank you, now I don't have the first error on the op-chaining-support.js, but still on the other:

image

So the pdf still not be charged.

Valma-EG commented 3 weeks ago

I just add this line in the constructor and now seems it works:

image

stephanrauh commented 2 weeks ago

@Valma-EG Did you check the URL of the missing files? Maybe the PDF loader tries to load the files from the wrong directory.