Skip navigation
tyerlv123
Currently Being Moderated

Get location of an annotation

Apr 3, 2012 12:13 PM

Tags: #acrobat #plugin #sdk

I am looking at getting the location/coordinates of an annotation and printing them.

 

I can get the annotation and appear to even get the coordinates but can't print them.

 

This is what i am trying:

 

ASFixedRect box;

PDAnnotGetRect(annot, &box);

 

ptr = (char *) &box.left;

sprintf(buf, "The annotation's location is %s", ptr);

AVAlertNote(buf);

 

Thanks,

 

Tyler

 
Replies
  • Currently Being Moderated
    Apr 3, 2012 5:34 PM   in reply to tyerlv123

    You can’t print them because you are trying to treat an ASFixed value as a char*.  Clearly that’s wrong.

    You should convert them from ASFixed to something standard like a float (ASFixedToFloat is your friend!) and then use the %f for sprintf.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 3:33 AM   in reply to tyerlv123

    It’s a structure, so just reference the members.  (props.size, etc)

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 9:18 AM   in reply to tyerlv123

    Sounds like you are having C/C++ development issues, not related to our SDK.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 9:49 AM   in reply to tyerlv123

    And the annotation you have is indeed of Subtype Redaction??

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 5, 2012 3:17 PM   in reply to tyerlv123

    You have to fill in the redactionProps.size member to the sizeof(PDRedactParams)

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 11, 2012 3:49 AM   in reply to tyerlv123

    You have the data right there – now use them as coordinate sets on the page.  Not sure what you are missing?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 11, 2012 8:59 AM   in reply to tyerlv123

    Remember to convert Fixed to something that you can print (like a float).

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 11, 2012 10:20 AM   in reply to tyerlv123

    Top, left, bottom, right.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points