Typescript PDFTron中未定义CoreControls错误
我不断地犯这个错误Typescript PDFTron中未定义CoreControls错误,typescript,pdftron,Typescript,Pdftron,我不断地犯这个错误 未捕获引用错误:未定义CoreControls import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; import DocumnetViewer = CoreControls.DocumentViewer; declare const WebViewer: any; @Component({ selector: 'app-root',
未捕获引用错误:未定义CoreControls
import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core';
import DocumnetViewer = CoreControls.DocumentViewer;
declare const WebViewer: any;
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit, AfterViewInit {
@ViewChild('viewer') viewer: ElementRef;
wvInstance: any;
ngAfterViewInit(): void {
/* some code */
const documentViewer = new DocumnetViewer();
documentViewer.displayPageLocation(3, 1, 3, true);
/* some code */
}
}
第2行出现错误。请帮我解决这个问题。提前谢谢
import DocumnetViewer = CoreControls.DocumentViewer;
它不是有效的导入语法。你从哪里得到这个密码的?。下面是一个如何将pdftron添加到angular的示例Ravin是正确的。我还将保留示例链接以供参考:。我还想指出,在最新版本中,您还可以通过
实例
访问CoreControls
。