Thanks for reply
I want to clarify something which u have asked.
I have a PDF file in which some of the text are highlighted with different colours. I want to extract those text from the PDF file with corresponding page number and store it into a text file(Text Format)in local system.
//My Code given below//
this.syncAnnotScan();
myAnnotList = this.getAnnots({npage: 0,type: "Highlight",strokeColor: color.yellow,nsortBy: ANSB_Page});
//open a new report Doc
var myReport = new Report();
myReport.size = 1.5;
myReport.color = color.blue;
myReport.writeText("Summary of Hilighted Comments with pageNo");
myReport.color = color.black;
myReport.writeText(" ");
myReport.writeText("Number of comments: "+ myAnnotList.length);
myReport.writeText(" ");
for(var i=0 ;i < myAnnotList.length ;i++)
{
if(myAnnotList[i].type == "Highlight")
{
myReport.writeText("Type: " + myAnnotList[i].type + "; Content: " + myAnnotList[i]+ "; Page:" + myAnnotList[i].page);
}
}
var FinalReport = new Report();
var Docrep = myReport.open(FinalReport.pdf);
In this code i am getting type of annotation and page number of corresponding Highlighted word or text but i am not getting the highlighted text.
I want to get the annotation type ,page number and highlighted text,
Please help me in this regards.
Thanks And Regards,
ESWER
Use the "doc.getPageNthWord()" and "doc.getPageNthWordQuad()" functions. It's actually not as complex as it sounds. Given the code you've already written, this should only be a few more lines. If you search the Acrobat JS Reference you'll find some examples that use these functions.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script