ngx-extended-pdf-viewer: Use of ngx-extended-pdf-viewer and this.checkHeight() is missing
Check this first
- Does the bug also happen on https://mozilla.github.io/pdf.js/web/viewer.htm? no
- Does the bug also happen on https://pdfviewer.net/simple? no
Describe the bug
I want tu use pdf viewer but there is an error on call from a simple html page. But the window.checkHeight() is not possible because my window has no checkHeight() function
core.js:4002 ERROR TypeError: Cannot read property 'clientHeight' of undefined
at NgxExtendedPdfViewerComponent.push../node_modules/ngx-extended-pdf-viewer/fesm5/ngx-extended-pdf-viewer.js.NgxExtendedPdfViewerComponent.checkHeight (ngx-extended-pdf-viewer.js:1392)
at NgxExtendedPdfViewerComponent.push../node_modules/ngx-extended-pdf-viewer/fesm5/ngx-extended-pdf-viewer.js.NgxExtendedPdfViewerComponent.openPDF (ngx-extended-pdf-viewer.js:1815)
at ngx-extended-pdf-viewer.js:1298
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:26247)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
at push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask (zone.js:498)
at ZoneTask.invoke (zone.js:487)
at timer (zone.js:3070)
Version info
- Version of ngx-extended-pdf-viewer : 1.6.2 and 3.3.1
- Version of the JavaScript files pdf.js, pdf-worker.js and viewer.js : I don’t know… default files used
Desktop (please complete the following information):
- OS: Windows10
- Browser: Chrome
- Version: Chrome 81.0.4044.138 (Build officiel) (64 bits)
To Reproduce
Source file html (the angular part is verified and all data inputs given by javascript functions or variables are correct) : joined html file.
I think I’m not defining a correct html to use pdf viewer but I don’t know where is the problem and how to correct.
Demo PDF file None
Screenshots None
Additional context None
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 47 (22 by maintainers)
Commits related to this issue
- #294 added a check if the DOM element is there before checking its height; added a few fields to the `IPDFViewerApplication` interface — committed to stephanrauh/ngx-extended-pdf-viewer by stephanrauh 4 years ago
- #294 accept string values for `[page]` — committed to stephanrauh/ngx-extended-pdf-viewer by stephanrauh 4 years ago
I found the problem with a string number… So I refactored all my html files for 1st problem and this one was simple.
I do this also for a company but as a non official project… on my leisure time.
Thank you I will check it tonight. I will tell you the answer later.