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

Choosing between Javascript and Plugin Development using Acrobat DC SDK

Explorer ,
May 29, 2020 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

1.2K

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
community guidelines
Community Expert ,
May 29, 2020 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. 

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

Votes

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
community guidelines
Explorer ,
May 29, 2020 May 29, 2020

Copy link to clipboard

Copied

Okay , thanks a lot for making this clear.

Votes

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
community guidelines
Community Expert ,
May 29, 2020 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? 

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

Votes

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
community guidelines
Explorer ,
May 29, 2020 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.

 

Votes

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
community guidelines
LEGEND ,
May 29, 2020 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. 

Votes

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
community guidelines
Explorer ,
May 29, 2020 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  ?

Votes

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
community guidelines
LEGEND ,
May 29, 2020 May 29, 2020

Copy link to clipboard

Copied

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

Votes

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
community guidelines
Explorer ,
May 30, 2020 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

Votes

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
community guidelines
LEGEND ,
May 30, 2020 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.

Votes

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
community guidelines
LEGEND ,
May 29, 2020 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. 

Votes

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
community guidelines
Explorer ,
May 29, 2020 May 29, 2020

Copy link to clipboard

Copied

Yes , this makes complete sense

Votes

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
community guidelines
Community Expert ,
May 30, 2020 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. 

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

Votes

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
community guidelines
Explorer ,
May 30, 2020 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 ?

 

Votes

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
community guidelines
Community Expert ,
May 30, 2020 May 30, 2020

Copy link to clipboard

Copied

LATEST

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. 

 

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

Votes

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
community guidelines