在我的angular 2应用程序中使用ng2-pdf-viewer时出现以下错误。请指导我解决此问题。
错误:
let line = SCNGeometry.line(from: startPosition, to: endPosition)
let lineNode = SCNNode(geometry: line)
lineNode.position = SCNVector3Zero
sceneView.scene.rootNode.addChildNode(lineNode)
Html:
ERROR TypeError: this._pdf is undefined
Stack trace:
../../../../ng2-pdf-viewer/dist/pdf-viewer.component.js/PdfViewerComponent.prototype.renderPage@http://localhost:4200/vendor.bundle.js:6275:9
../../../../ng2-pdf-viewer/dist/pdf-viewer.component.js/PdfViewerComponent.prototype.render@http://localhost:4200/vendor.bundle.js:6251:13
../../../../ng2-pdf-viewer/dist/pdf-viewer.component.js/PdfViewerComponent.prototype.onPageResize/this.resizeTimeout<@http://localhost:4200/vendor.bundle.js:6224:13
../../../../zone.js/dist/zone.js/</</ZoneDelegate.prototype.invokeTask@http://localhost:4200/polyfills.bundle.js:2970:17
onInvokeTask@http://localhost:4200/vendor.bundle.js:114446:24
../../../../zone.js/dist/zone.js/</</ZoneDelegate.prototype.invokeTask@http://localhost:4200/polyfills.bundle.js:2969:17
../../../../zone.js/dist/zone.js/</</Zone.prototype.runTask@http://localhost:4200/polyfills.bundle.js:2737:28
../../../../zone.js/dist/zone.js/</</ZoneTask.invokeTask@http://localhost:4200/polyfills.bundle.js:3044:24
ZoneTask/this.invoke@http://localhost:4200/polyfills.bundle.js:3033:28
timer@http://localhost:4200/polyfills.bundle.js:4441:17
以下是组件:
<pdf-viewer [src]="pdfSrc"
[page]="page"
[original-size]="true"
style="display: block;"
></pdf-viewer>