Choosing between Javascript and Plugin Development using Acrobat DC SDK

Explorer ,
May 29, 2020

Copy link to clipboard

Copied

Hello everyone, 

 

I am a beginner in developing Acrobat functionalities and have been provided with this task of having a button added to the toolbar , which when clicked , a popup should appear with a button , which when clicked does two things  : 1) Makes a post request to a server  and 2) Launches  a particular web page.

 

After going through the Acrobat SDK documentation, I found that Javascript provides methods for two of these functionalities i.e. namely making a post request (using Net.HTTP object) and launching a web page (using launchURL). But the issue with Javascript was , it is not possible to add the button directly to the toolbar, yes I know we can customize the toolbar by adding the add-on tool to the toolbar but that requires some hand work.

 

 

On the other hand , the Acrobat SDK documentation provides for adding a button to the toolbar directly using plugins, but I had also read that plugins do not provide support for web services. 

 

 

So given the use-case  and the requirements, what would be your suggestion?

 

Specifically it would be nice if you could answer the following questions:

1) Which one would be better to go with Javascript or plugin development ?

 

Plugin development related queries:

2) Is it possible to develop a plugin and save it in the plug_ins folder of Acrobat Reader DC and see the plugin in action OR is it that Acrobat Professional is needed to develop plugins ? (this is only to know if I can develop plugins locally on my laptop or would I need Acrobat Pro even for development purposes)

 

3)Would it be possible to make post requests and launch webpage via plugin development ?

 

TOPICS
Acrobat SDK and JavaScript

Views

442

Likes

Translate

Translate

Report

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

Choosing between Javascript and Plugin Development using Acrobat DC SDK

Explorer ,
May 29, 2020

Copy link to clipboard

Copied

Hello everyone, 

 

I am a beginner in developing Acrobat functionalities and have been provided with this task of having a button added to the toolbar , which when clicked , a popup should appear with a button , which when clicked does two things  : 1) Makes a post request to a server  and 2) Launches  a particular web page.

 

After going through the Acrobat SDK documentation, I found that Javascript provides methods for two of these functionalities i.e. namely making a post request (using Net.HTTP object) and launching a web page (using launchURL). But the issue with Javascript was , it is not possible to add the button directly to the toolbar, yes I know we can customize the toolbar by adding the add-on tool to the toolbar but that requires some hand work.

 

 

On the other hand , the Acrobat SDK documentation provides for adding a button to the toolbar directly using plugins, but I had also read that plugins do not provide support for web services. 

 

 

So given the use-case  and the requirements, what would be your suggestion?

 

Specifically it would be nice if you could answer the following questions:

1) Which one would be better to go with Javascript or plugin development ?

 

Plugin development related queries:

2) Is it possible to develop a plugin and save it in the plug_ins folder of Acrobat Reader DC and see the plugin in action OR is it that Acrobat Professional is needed to develop plugins ? (this is only to know if I can develop plugins locally on my laptop or would I need Acrobat Pro even for development purposes)

 

3)Would it be possible to make post requests and launch webpage via plugin development ?

 

TOPICS
Acrobat SDK and JavaScript

Views

443

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 29, 2020 0
Adobe Community Professional ,
May 29, 2020

Copy link to clipboard

Copied

The Acrobat SDK does not provide support for web services because it's for Acrobat, not for accessing the web.  If you want perform a post, then add a library for doing that your project. The plug-in is just a DLL. You can access whatever system services or libraries you need, just as long as they don't violate security in Acrobat. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 29, 2020 1
Explorer ,
May 29, 2020

Copy link to clipboard

Copied

Okay , thanks a lot for making this clear.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 29, 2020 0
Adobe Community Professional ,
May 29, 2020

Copy link to clipboard

Copied

The NET.HTTP object does not operate in Reader. So you can't use it there anyway. Developing a plug-in for Reader requires permission from Adobe and a big fee. So you've got some road blocks.

 

On the other hand. The JavaScript "doc.submitForm()" function can do a HTTP post, what exactly is it you are trying to post? 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 29, 2020 0
Explorer ,
May 29, 2020

Copy link to clipboard

Copied

" The NET.HTTP object does not operate in Reader. So you can't use it there anyway "

 

Yes I had read this in the documentation but anyways we are aiming at adding these functionalities for Acrobat Pro. So just to make things clear , our company has  Acrobat Pro for all of its employees, but as of now the developers do not have access to making changes in folders such as plug_ins (for developing plugins) and Javascripts (for developing scripts), for security reasons. We were able to develop scripts and see the functionality working , thanks to the user-level javascripts folder , where we could make changes.

 

"Developing a plug-in for Reader requires permission from Adobe and a big fee."

 

I had read this statement in the documentation : " When Acrobat or Acrobat Reader starts, it scans the plug_ins folder (in the same directory as the Acrobat executable) for DLLs with the extension .API. " and thus assumed that I would be able to develop plugins locally  without any fee and see the output as well (in my case , getting a button attached to the toolbar), is my assumption wrong ? As I have stated that we cannot make changes in the plug_ins folder of the Acrobat Pro that the company provides, so I just wanted to know if I would be able to develop plugins locally using the Acrobat Reader DC that I have on my personal desktop. I hope that I could make my question clear.

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 29, 2020 0
Most Valuable Participant ,
May 29, 2020

Copy link to clipboard

Copied

Your quote shows how Acrobat and Reader scan for API files. Reader then checks plugins have a license from Adobe. License fees are by negotiation and Adobe only approve plugins which work with their business model. (A plugin which gives services that could be got by buying Acrobat for each user would be rejected probably). 

Plugins cannot add to the Quick Bar. They can create tools that the USER CAN ADD MANUALLY. They can add menu items. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 29, 2020 1
Most Valuable Participant ,
May 29, 2020

Copy link to clipboard

Copied

One more thing: every plugin developer needs a license for Acrobat, to develop it, even if developing a plugin that is eventually licensed for Reader. Remember: the SDK exists only to sell software. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 29, 2020 1
Explorer ,
May 29, 2020

Copy link to clipboard

Copied

Yes , this makes complete sense

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 29, 2020 0
Explorer ,
May 29, 2020

Copy link to clipboard

Copied

 " Reader then checks plugins have a license from Adobe.  "

Thanks for pointing this out.

 

" Plugins cannot add to the Quick Bar ."

Yes but we can add the button to the File toolbar using plugins right  ?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 29, 2020 0
Most Valuable Participant ,
May 29, 2020

Copy link to clipboard

Copied

What exactly do you mean by the "File toolbar" please?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 29, 2020 0
Adobe Community Professional ,
May 30, 2020

Copy link to clipboard

Copied

If the users in your company have Acrobat pro, then your best bet is to use the NET.HTTP object for posts. There is a testing tool for this object here:

https://www.pdfscripting.com/public/HTTP-Access-Tester-Description.cfm

 

You'll need to be a member to download it.  If you join the site, I offer consulting for just this kind of thing at discount rates. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 30, 2020 0
Explorer ,
May 30, 2020

Copy link to clipboard

Copied

When the Acrobat SDK documentation says that using plugins , we can create buttons and attach them to the toolbar ,I believe it means attaching them to the bar that I have marked with a blue border in the below image.

Am I correct ? and by the Files toolbar I mean that portion of the toolbar with File related tools (marked with the red arrow)toolbar.jpeg

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 30, 2020 0
Most Valuable Participant ,
May 30, 2020

Copy link to clipboard

Copied

This is the "Quick bar". As I said, your plug-in cannot add buttons to this bar, or change it. (The plug-in API talks about creating toolbars but this is an abstract concept not a UI interface). But a plug-in can register new buttons that the user can CHOOSE to add at the right. At least in Acrobat. I do not know if this is possible in Reader. In Acrobat, right click and choose Customize Quick Bar. Your toolbars registered in a plug-in will appear at the bottom of the list. This is poorly documented, if at all, but I can report it does work.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 30, 2020 1
Explorer ,
May 30, 2020

Copy link to clipboard

Copied

@Thom_Parker, so given that we are trying to develop this functionality for Acrobat Pro , do  you think developing a plugin would  be an overkill and we should rather rely on JS scripts  atleast for the button , pop-up and the post request ?

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 30, 2020 0
Adobe Community Professional ,
May 30, 2020

Copy link to clipboard

Copied

For what you've listed as requirements, a plug-in is overkill.

 

Plugins add buttons to a tool category.   The tool categories are all listed in the Acrobat Tools area. For example, "Comments" is a tools category. When I create a plug-in, I usually create a new category specifically for the tool I'm creating, or I use one such as PDF Scripting, that is for all tools downloaded from my website. 

 

I don't know if I've mentioned this on this thread, but the quickbar is defined in a set of preferences in the Acrobat user Prefs folder. In a file named User_Prefs.txt. or something like that. You could change this file from outside of Acrobat to put your tool button on the quickbar. Just don't mess it up. 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 30, 2020 1