【发布时间】:2020-06-26 08:20:21
【问题描述】:
我正在尝试使用 PDFTron 库 "@pdftron/webviewer": "^6.2.3" ,从这个示例开始 - https://github.com/PDFTron/webviewer-angular-sample
他们有 CoreControls 命名空间,描述如下:
export declare namespace CoreControls {}
在我正在使用的 app.component.ts 中
import {CoreControls} from '@pdftron/webviewer';
接下来我想用这个:
ngOnInit() {
CoreControls.createDocument('blabla');
}
得到了这个错误
"ERROR TypeError: Cannot read property 'createDocument' of undefined".
一般来说,我需要在没有 WebViewer 的情况下使用他们的 API,比如这里 - https://www.pdftron.com/documentation/web/guides/get-file-data-without-viewer/ 。但是确实有些问题,也许我不理解 angular right 或 TS,或者 PDFTron 没有针对 angular 进行优化。
我不明白我不明白的。
【问题讨论】:
标签: angular typescript pdftron