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

Adobe Reader plugin to get selected text from pdf and add in tree view like explorer

New Here ,
Jan 11, 2019 Jan 11, 2019

Copy link to clipboard

Copied

I have been given a task to add a plugin in Acrobat. There will be an icon in toolbar and clicking on that will open an explorer. When user select some text from pdf document then a context menu should open with some options in it. And when user picks an option then selected text becomes the part of explorer. All the selections that user will make becomes the part of explorer in a tree view structure. Once user save the pdf file then it should be saved somewhere in header so that when file is viewed the Adobe Reader then all the selections remain visible in the form of tree view.

Can I create a plugin that contains above mentioned features? If yes then what should I read?

There are so many things that I need. I have started to look into samples that are provided with Acrobat DC SDK and able to run those with Acrobat. Any help would be highly appreciated.

Thanks

TOPICS
Acrobat SDK and JavaScript

Views

1.4K

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 ,
Jan 11, 2019 Jan 11, 2019

Copy link to clipboard

Copied

This does not sound impossible, so long as Adobe approve it for Reader. They might not, so apply early. From your description you want to edit the file (by which I mean change what is in the PDF internally) and then save it, and that's not approved Reader plug-in behaviour. You write your plug-in for Acrobat of course but at some point you need to plan for getting a Reader license and using the smaller Reader API. (Tip: you could store the tree view outside the PDF file: consider the implications of that.)

The tree view would probably be done with the platform API, not Acrobat, shown in a Window.

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
New Here ,
Jan 11, 2019 Jan 11, 2019

Copy link to clipboard

Copied

Thanks for your reply.

I don't want to edit file. I file to select some text from file and when user finishes the selection (for example he select two words) then I want a context menu to open with few options. And when user click on any option then selected text becomes the part of tree view. Something like below

TreeView.png

I want to save this tree view in the pdf header or somewhere else. So that if user wants to open the document again then tree view is visible. I will explore platform API as well.

Thanks

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 ,
Jan 12, 2019 Jan 12, 2019

Copy link to clipboard

Copied

Yes, you want to edit the file. You don't want to change the file's appearance, sure, but you said clearly you want to save the contents INSIDE the PDF. That's editing, and it isn't usually allowed.

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 ,
Jan 12, 2019 Jan 12, 2019

Copy link to clipboard

Copied

PDF files, by the way, don't have "headers" you can add to, but you can add to various of the dictionaries in the PDF. You need to register a developer prefix for the names you add. You will need some knowledge of the PDF file format, documentation of which is in the SDK.

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 ,
Jan 13, 2019 Jan 13, 2019

Copy link to clipboard

Copied

LATEST

If you are going to write a plug-in, then before devising a specific strategy, you will first need to understand how PDF files are put together. I would suggest you read the PDF reference. This understanding is a necessary first step to understanding the Acrobat SDK. The SDK comes with several sample projects, try out a couple, also look through the code in the snippet runner for anything to do with text. I don't know if any specifically deal with text selections, but they'll all be instructive.

You can certainly create a popup window that displays a tree view. This type of display has nothing to do with Acrobat/Reader. The plug-in uses the UI provided by the OS. So in the case of Windows, you can use MFC or the windows primitives, it's up to you. I prefer MFC for a complex UI.

In fact, the PDF CanOpener plug-in displays the PDF internal structure as a tree. This is a Windows plug-in that is indispensable for writing a plug-in, because it not only displays the PDF structure, it also allows you to modify it, so you can prototype modifications to the PDF. 

Finally, there are special restrictions on creating plug-ins for Reader. You can read about these in the on-line SDK documentation.

Acrobat DC SDK Documentation

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