Copy link to clipboard
Copied
Hi, I have developed a plugin for Acrobat and Acrobat Reader that works fine if the "Enable Protected Mode at startup" checkbox is selected.
When the checkbox is NOT selected, or when it is disabled, my plugin doesn't load.
Is this expected? Is there some way to get my plugin to load when Protected Mode is disabled?
Copy link to clipboard
Copied
No, this is not normal. But the most likely cause is code in your plug-in that is causing it to not load.
In the PluginInit.cpp file, make sure that the PluginExportHFTs(), PluginImportReplaceAndRegister(), and PluginInit() functions are returning true.
Copy link to clipboard
Copied
Thanks @Thom Parker for the reply.
I can verify that the three methods are returning true. It's good to know the plugin actually is loading in this case.
My plugin does use a Sandbox IPC Broker (`sandboxpisdk::InitSandboxPIBrokerIPCChannel`), and this is failing.
Is this a limitation with running in non-Protected Mode?
Copy link to clipboard
Copied
The sandboxpisdk::InitSandboxPIBrokerIPCChannel() function returns false when Protected mode is turned off. It only returns true in Protected mode if the specified broker exe file exists. But either way this doesn't affect whether or not the plug-in is loaded.
BTW, how are you determining if the plug-in is loaded?
Have you set breakpoints and walked through the plug-in initialization?
Copy link to clipboard
Copied
I see. I guess that makes sense that InitSandboxPIBrokerIPCChannel returns false if the plugin isn't running in a sandbox.
It sounds like if I want my plugin to support running with Protected Mode on and off, I will need to write it a little differently.
If Protected Mode is off, the plugin should have access to system resources like file system and registry, and if Protected Mode is on, I will need to access those resources via the broker.
I did spend some time today debugging the plug-in initialization, and that was helpful.
As for how I was determining if the plugin was loading, I was making incorrect assumptions. The plugin was loading all along, it just wasn't behaving how I had thought it would.
Is there a simple way in Acrobat to know which plugin(s) are loaded?
Copy link to clipboard
Copied
You are correct about how protected mode works.
An easy way to see all the loaded plug-ins is to open the Acrobat JavaScript Console window and run this code:
app.plugIns
The plug-ins I write all have an about box entry in the "Help->About 3rd Party Plugins" menu. That and a command menu item, which makes it easy to check whether its loaded or not.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now