Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Acrobat Plugin Doesn't Load When "Enable Protected Mode at startup" is Not Selected

New Here ,
Feb 06, 2025 Feb 06, 2025

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?

TOPICS
Acrobat SDK and JavaScript
312
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 06, 2025 Feb 06, 2025

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. 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 06, 2025 Feb 06, 2025

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 06, 2025 Feb 06, 2025

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?

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 06, 2025 Feb 06, 2025

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 06, 2025 Feb 06, 2025
LATEST

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. 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines