Before using DynaPDF functions in our plugin, you have to initialize that part of the plugin. For that you call DynaPDF.Initialize function and pass path to the location of the DynaPDF dll or dylib.
Now our example code always used to use a $$DynaPDFInited variable to check the state. But that has two disadvantages:
- First it may also be set if initialization failed. So if you run a script, it fails, you than put the library where it should be and try again, it will not initialize again.
- Second with using a server, you may need to initialize both on server and client. But you only have one global variable. This causes trouble if initialization is done on client, but not on server.
- Third on a server, if the Scripting Engine process is restarted, the variable has the wrong value as the DynaPDF library is unloaded with the end of that process.