Not rendering PDF in angular 17, ng2-pdf-viewer : v10.0.0
Chethan3939 opened this issue · 2 comments
I am trying to render Demo pdf file in my project and i am getting error as seen below :
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
You can try again with 10.2.2. You don't need to install pdfjs yourself.