What is the best way to add custom action for Sharepoint document?

Solution for What is the best way to add custom action for Sharepoint document?
is Given Below:

I am totally new to Sharepoint development. The task is to add custom action to some sharepoint document file types (pdf) – right-click menu item – which will perform some simple Java Script action on client site. And this extension should be easily deployed to different Sharepoint websites. What is the best way to do it? Do I need to develop Sharepoint Add-In or something else? Which technologies should I use?
Thanks in advance.

Yes, you could develop SharePoint Add-In to create custom actions.

Please refer to this official articles for more: Create custom actions to deploy with SharePoint Add-ins