Skip to main content
New Participant
August 11, 2022
Answered

Is it possible to access a DLL from a plugin?

  • August 11, 2022
  • 2 replies
  • 809 views

I am trying to integrate hardware security to a pdf file. I am using a USB dongle which I normally use as a software piracy protect scheme. It works by linking a DLL to an application's source code, and checking that the dongle is plugged in before loading the application. Then you call the functions from the DLL and it authenticates that the USB dongle is attached, and that it is programmed with the correct codes. I'd like to create code which can add this functionality to pdf documents, as relying on a password for distributing a pdf file seems only mildly secure. If I can get it working the dongle would be a great way to create 2 factor authentication for pdf documents. 

 

From some cursory research it is apparent that there is not a way to load DLL's using the standard Acrobat Javascript references. However, I see there is support for creating custom plugins. Before I sink a lot of time and research only to find out this wont work, I wanted to create a post to get some expert opinions. So, is what I am attempting possible? If you need any additional information to know for certain I can certainly provide it. Thanks!

 

This topic has been closed for replies.
Correct answer Test Screen Name

Yes, but here are a few traps to look out for.

1. If you use LoadLibrary to load a DLL from a plug-in, the plug_ins folder (where plug-ins must be installed) is not in the DLL search path. If you have the DLL alongside the plug-in, you need to set the path explicitly.

2. Because of this, simply relying on automatic linkage to a DLL cannot work if the DLL is alongside the plug-in.

3. Protected Mode MIGHT block you since its job is to block access to files.

4. All functions inside a plug-in are synchronous. This means that if the DLL does something that takes a long time (either normally, or eg to timeout a network request), then Acrobat is blocked.

5. If you want your plug-in to work with the free Reader, this requires a special license, granted only on whim of Adobe, if they judge you are strategically important.

6. Another plug-in could freely save a copy of your protected file, post decryption.

2 replies

Test Screen NameCorrect answer
Brainiac
August 11, 2022

Yes, but here are a few traps to look out for.

1. If you use LoadLibrary to load a DLL from a plug-in, the plug_ins folder (where plug-ins must be installed) is not in the DLL search path. If you have the DLL alongside the plug-in, you need to set the path explicitly.

2. Because of this, simply relying on automatic linkage to a DLL cannot work if the DLL is alongside the plug-in.

3. Protected Mode MIGHT block you since its job is to block access to files.

4. All functions inside a plug-in are synchronous. This means that if the DLL does something that takes a long time (either normally, or eg to timeout a network request), then Acrobat is blocked.

5. If you want your plug-in to work with the free Reader, this requires a special license, granted only on whim of Adobe, if they judge you are strategically important.

6. Another plug-in could freely save a copy of your protected file, post decryption.

ZamochitAuthor
New Participant
August 19, 2022

Thanks for the information! Could you tell me where I could find information on the special license for working with the free version of Adobe? If we cannot work on the free verion of Adobe that may be a dealbreaker for our customers.

Brainiac
August 19, 2022

It should be a chapter in the Acrobat SDK.

Bernd Alheit
Community Expert
August 11, 2022

On Windows a Acrobat plugin is a DLL with the file extension .api