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

How to activate annotation by clicking

Community Beginner ,
Jun 12, 2019 Jun 12, 2019

Copy link to clipboard

Copied

How to activate annotation by cliking on it , I write annotation to bbox on page , I want to highlight it after adding , so that user can see where to click. And also , i want to add clicking fucntionality to it ( activation after clicking ) what callbacks or smth should I use ?

TOPICS
Acrobat SDK and JavaScript

Views

839

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

Copy link to clipboard

Copied

Neither of these can be done with a markup annotation.

What is your ultimate goal? Perhaps there is another way.

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

Copy link to clipboard

Copied

I have 3d annotation , my ultimate goal is to allow user to chose what annotation to chose in the current page and select this annotation , after clicking on it , opens external viewer

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

Copy link to clipboard

Copied

3D Annots have the advantage or their own JS context and a communication pipe with Acrobat JS. So while it's not possible to select a 3D annot from a script, code can interact with it to do other things.

However, this is the wrong forum for your question. Repost to the 3D forum

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

Copy link to clipboard

Copied

Thank you for the answer ! But im using sdk with c++ , I have the code that's creating annotation in bbox

ASFixedRect annotBox = {ASInt32ToFixed(108), ASInt32ToFixed(612 - 108),

  ASInt32ToFixed(792 - 108), ASInt32ToFixed(108)};

  // Add new 3D annot to page

  theAnnot = PDPageAddNewAnnot(pdPage, -2, ASAtomFromString("AnyType"), &annotBox);

  PDAnnotSetFlags(theAnnot, pdAnnotPrint | pdAnnotReadOnly);

  HANDLER

But my question is , how can i write annotation not only in the given box , but how can I do this using the mouse selection area , in any position on the page.

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

Copy link to clipboard

Copied

So you are writing a plug-in that the user will use will have installed. That's different, an easy solution is to monitor the mouse buttons and compare clicks against the annot location.

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

Copy link to clipboard

Copied

Thank you for the answer ! But how can I monitor mouse buttons ? Which methods / callbacks you will recommend to use ?

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

Copy link to clipboard

Copied

And maybe I can somehow highlight the bbox area in which annotation exists , so user can see where to click?

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 ,
Jun 14, 2019 Jun 14, 2019

Copy link to clipboard

Copied

LATEST

To get mouse clicks you register an event handler for it.

AVAppRegisterForPageViewClicks(AVPageViewClickProc clickProc, void* data)

Look it up.

There are different ways to highlight something on the page. For example, you could create your own selection server, but the easy way is to just draw a rectangle around something when the page refreshes. For this you register another type of handler

void AVAppRegisterForPageViewDrawing(AVPageViewDrawProc proc, void* data)

You should spend some time looking over both the API reference and the usage docs.

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