Hello.
Question: Can I add multiple quads to a single annotation? If so, I am hoping to find out how.
Task: To highlight (with a comment) full sentences or paragraphs in a PDF.
Problem: I cannot find a way to add more than one 'quad' to a single annotation. If the sentence spans 3 lines then it seems I will need 3 separate quads that are somehow linked and act as one (i.e. If the user deletes one quad, the others are deleted too). One big highlight will not suffice as the sentence may only cover 2.5 lines.
Overall Script Structure: I already have script that provides a range of words that need to be highlighted as one group (e.g. nth word 12 to 25, and 28 to 35). I will obtain the quad of each word within the range and create a single quad that covers as many of the words as possible. However, each new line will require a new quad. Once I have the quads I will create a single annotation, with a single comment, and hopefully with multiple quads.
What have I tried: I have done plenty of searching (with many different approaches) but no luck. I found another post titled 'How to combine quads?' but I couldn't see a working solution. I tried many different forms of code, with the following being the most logical (The code is a replica because I don't have Acrobat on this machine); but nothing has worked so far.
var quadArray = new Array();
quadArray[0] = this.getPageNthWordQuads(1, 2);
quadArray[1] = this.getPageNthWordQuads(1, 6);
var annot = this.addAnnot({
page: 1,
type: "Highlight",
quads: quadArray;
author: "Test",
contents: "Second and fifth word on second page"
});
This is my first post, so please let me know if I have left out important information. As usual, any help would be appreciated.
Thanks