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

Not rendering PDF in angular 17, ng2-pdf-viewer : v10.0.0 #1082

Open
Chethan3939 opened this issue Apr 25, 2024 · 1 comment
Open

Not rendering PDF in angular 17, ng2-pdf-viewer : v10.0.0 #1082

Chethan3939 opened this issue Apr 25, 2024 · 1 comment

Comments

@Chethan3939
Copy link

I am trying to render Demo pdf file in my project and i am getting error as seen below :
pdf-viewer error

Although, I was able to render the same pdf at App.component.ts file.
Here's the code for the same :

HTML :
`


<pdf-viewer src="C:\Angular Project\pre-flight pro\preflightpro\apps\preflight\src\assets\file.pdf"
(after-load-complete)="afterLoadComplete($event)"
(error)="onError($event)"
(on-progress)="onProgress($event)"
(page-rendered)="pageRendered($event)"
[show-borders]="true" style="display: block; width: 100vw; height: 100vh;">

`

TS file :
`afterLoadComplete($event){
console.log("from load complete",$event);
}

onError($event){
console.log("from error ",$event);
}

onProgress($event){
console.log("from progress complete",$event);
}

pageRendered($event){
console.log("from pageRendered complete",$event);
}`

but was not able to do the same in another component in my project.
Checked my pdfjs-dist version as well even after upgrading to "2.4.456" I am still getting the same error.
Please let me know what needs to be done on this. Any help is appreciated.

Thanks
Chethan G

@VadimDez
Copy link
Owner

You can try again with 10.2.2. You don't need to install pdfjs yourself.

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