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

A way to get coordinates of Select Box

Community Beginner ,
Feb 05, 2018 Feb 05, 2018

Copy link to clipboard

Copied

I'm trying to figure out a way to get the coordinates or location of when you as a user are using the pointer, you can select an area(represented by a blue box). I would want that blue box location and save it. Then I would like to be able to recreate that. So I could click a button and that select box would appear at that location again. In a way its similar to what the bookmark feature can do except that just uses zoom.

The reason I need this is to add a feature to a ERP application I am creating. Customers send emails with pdf attachments. We quote them according to what they say in that pdf file. As a user, I want to be able to select a location in a pdf file, save it, and continue. That way when a product is shipped, for example, with the color purple, and the customer is upset because he didn't want purple, we could easily show the customer where exactly he/she said that in the pdf file. We wouldn't have to waist time looking through all the pdf files the user sent to find it.

TOPICS
Acrobat SDK and JavaScript

Views

4.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

correct answers 1 Correct answer

Community Expert , Feb 06, 2018 Feb 06, 2018

You'd have to find them and save them yourself. A tool could be written to do this for you. For example, you'd draw a rectangle on the page and the tool would use the rectangle to generate the fragment string for your URL.

Votes

Translate

Translate
Community Expert ,
Feb 05, 2018 Feb 05, 2018

Copy link to clipboard

Copied

Acrobat Professional has several different tools for making selections. Which tool are you referring too? Or are you referring to something in Acrobat Reader? 

Within Acrobat JavaScript there is a methodology for capturing the mouse coordinates, but this method interferes with the use of the selection tools. And JavaScript has no access at all to the Acrobat Selection tools, so this information is not available.

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
Community Beginner ,
Feb 05, 2018 Feb 05, 2018

Copy link to clipboard

Copied

The selection tool I'm referring to is selecting an area which could include an image, text, shapes, etc. With that selection I could save it and name it and when I decide to access that selection, it would perform an action that would jump to that specific location on that page selecting that area again. The key to all of this is being able to save that object(selection) which can be access outside of Acrobat so I could click on a link, it would open up that pdf file, and go to that location. That is the dream anyway haha. I know that Acrobat wouldn't be able to do this by just an URL, but maybe with some kind of macro if the selection tools are available.

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
Adobe Employee ,
Feb 05, 2018 Feb 05, 2018

Copy link to clipboard

Copied

Actually, Acrobat is PERFECTLY CAPABLE of doing that from a URL! This is part of the URL fragment identifiers, which are standardized for PDF in ISO 32000-2 (the PDF standard itself). You can also find this info in the draft spec for the application/PDF media type at https://www.ietf.org/archive/id/draft-hardy-pdf-mime-00.pdf

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 Beginner ,
Feb 06, 2018 Feb 06, 2018

Copy link to clipboard

Copied

To respond to Irosenth, I did know about this and it kinda does have what I would want, which is the highlight. When you use that command, it does the same thing as if a user selected an area(highlight or that blue box selector). The only issue is being able to save those coordinates. Lets I used that command by setting it to "hightlight=100,200,300,400". How does acrobat return those values? What would the function be? "GetHighlight()" ?

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 ,
Feb 06, 2018 Feb 06, 2018

Copy link to clipboard

Copied

You'd have to find them and save them yourself. A tool could be written to do this for you. For example, you'd draw a rectangle on the page and the tool would use the rectangle to generate the fragment string for your URL.

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
Adobe Employee ,
Feb 06, 2018 Feb 06, 2018

Copy link to clipboard

Copied

You can write either a custom plugin to Acrobat to do this or possibly use some embedded JavaScript in the PDF.

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 Beginner ,
Oct 09, 2019 Oct 09, 2019

Copy link to clipboard

Copied

LATEST
Any progress on finding out how to do this? I am also looking for a solution to capture the cursor coordinated, possible on a mouse-up event.

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 ,
Feb 05, 2018 Feb 05, 2018

Copy link to clipboard

Copied

I assumed you wanted to capture this data transparently from the user. My mistake. You can easily create named destination for each navigation area, then use the PDF Open parameters Leonard mentions to open the PDF from an URL.

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
Community Beginner ,
Feb 06, 2018 Feb 06, 2018

Copy link to clipboard

Copied

But isn't the name destination used for jumping to pages? I wasn't able to get it to work like bookmarks.

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 Beginner ,
Feb 08, 2018 Feb 08, 2018

Copy link to clipboard

Copied

I will look more into creating a plugin for this, thank you both.

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 ,
Feb 08, 2018 Feb 08, 2018

Copy link to clipboard

Copied

You don't really need a plug-in. This is well within the capabilities of JavaScript, which is much easier (by leaps and bounds) than writing the equivalent plug-in.

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