Trying to utilize the PDFTron library known as "@pdftron/webviewer" with version "^6.2.3". I am starting off with this sample code provided at https://github.com/PDFTron/webviewer-angular-sample
The library includes a CoreControls namespace, which is described as follows:
export declare namespace CoreControls {}
In my app.component.ts file, I have imported it using:
import {CoreControls} from '@pdftron/webviewer';
Now, when attempting to use it like this:
ngOnInit() {
CoreControls.createDocument('blabla');
}
An error occurred stating:
"ERROR TypeError: Cannot read property 'createDocument' of undefined".
I am interested in utilizing their API without WebViewer, as demonstrated here - . However, something seems amiss, whether it be my understanding of Angular or TypeScript, or perhaps the compatibility of PDFTron with Angular.
It seems like there are things that I do not quite comprehend.