What errors are you getting, exactly?
What exact error messages you're getting? Also, the code you're using assumes there are annotations on the current page. Is that always the case? If there are no annotations on that page, getAnnots() returns null, which would cause an execption when you try to access the first item in the array that you expect it to return.
If you want to get the annotations of the first page, for example, replace this.pageNum in the first line with 0.
It just varies between:
top is not defined
"undefined" is an indication that the script actually finished without errors...
Ok. Where are the output array numbers then? Those are what I need.
That would be the variable called "qd", in this case.
You can print it to the console like so:
I had tried that. I get "true" as the output.
Post your entire code.
var rct = getAnnots(this.pageNum).rect;
var left = rct;
var right = rct;
var top = rct;
var bot = rct;
qd = [ [left, top, right, top, left, bot, right, bot] ]
1 person found this helpful
Try it again. It prints the entire quads array to the console (followed by
"true"). Make sure to select the entire code when executing it.
PS - the penultimate line in your code does nothing, since you're not
assigning its result to any variable.
I got it. Thanks for all your help.