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

How can get coordinates of PDEElement?

Enthusiast ,
Apr 01, 2017 Apr 01, 2017

This is my code add a Rectangle to PDEElement:

AVRect rect;

PDEElementGetBBox (pdeElement, &bbox);

AVPageViewRectToDevice (pageView, &bbox, &rect);

sprintf(jsScript, "var a = this.addAnnot({page:%d,type:'Square'}); a.name='%s';a.rect=[%d,%d,%d,%d];  ",i,"P"+j, rect.left ,rect.top , rect.right, rect.bottom);   AFExecuteThisScript (myPDDoc , jsScript, NULL);

Position of Rectangle  in Result not correct.

How can get coordinates of PDEElement?

Thanks all.

TOPICS
Acrobat SDK and JavaScript
855
Translate
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

Adobe Employee , Apr 01, 2017 Apr 01, 2017

Why are you converting to device rects. Skip that step and you should be fine.

BUT if you are already using the C++ APIs, why switch to JavaScript? Why not do all this using PD calls such as PDPageAddAnnot?

Translate
Adobe Employee ,
Apr 01, 2017 Apr 01, 2017

Why are you converting to device rects. Skip that step and you should be fine.

BUT if you are already using the C++ APIs, why switch to JavaScript? Why not do all this using PD calls such as PDPageAddAnnot?

Translate
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
Enthusiast ,
Apr 02, 2017 Apr 02, 2017

I'm sorry, I had try this code and it add ok, but not exist color, so i can't see rectangle.

PDAnnot annot;

//Create a PDAnnot object

  annot = PDPageCreateAnnot (pdPage, ASAtomFromString("Square"),&bbox);

  PDPageAddAnnot(pdPage,-2, annot);

How set boder color of rectangle?

Translate
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
Enthusiast ,
Apr 02, 2017 Apr 02, 2017

Thanks, i had can set boder color , found at https://forums.adobe.com/thread/1517372?q=change%20color

Translate
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 ,
Apr 03, 2017 Apr 03, 2017
LATEST

You are looking at the values as floating point – but they are NOT, they are Fixed (ASFixed). If you look at them as fixed point, they will be fine.

Translate
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