Highlight annotation contents

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
davestevens
User
Posts: 5
Joined: Thu Oct 31, 2013 2:41 pm

Highlight annotation contents

Post by davestevens »

Hello,

We're having an issue getting the text content of highlight annotations in PDF files. We're using javascript to parse the annotations and their properties. All other properties seem correct, i..e page, color and quads. But the contents and richContents properties are always empty, and we're not sure why. We're hoping you can help. This is the javascript we are using to log the annotation properties to console:

Code: Select all

var annots=this.getAnnots();
if(annots!=null){
	for(var i=0;i<annots.length;i++){
		var ann = annots[i];
		var p = ann.getProps();
			for ( o in p ) 
				console.println( o + " : " + p[o] );
	}
}
If it isn't possible to use the contents or richContents properties, is there another way to get the text of the highlight annotations? We've tried using

Code: Select all

getPageNthWord
with the quads, but it is not appearing to be very accurate.

Thanks,
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Highlight annotation contents

Post by Ivan - Tracker Software »

It is possible to get richContent from highlight annotation when there is text. But if there are no text you will have an empty array instead.

When you create new highlight annotation, highlighted text is not automatically copied as a content of the annotation.
The Editor has an option "Copy selected text into Highlight, Cross-Out, and Underline comment pop-ups" on Editor's preferences "Commenting" page.

HTH
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
davestevens
User
Posts: 5
Joined: Thu Oct 31, 2013 2:41 pm

Re: Highlight annotation contents

Post by davestevens »

Ivan - Tracker Software wrote:It is possible to get richContent from highlight annotation when there is text. But if there are no text you will have an empty array instead.

When you create new highlight annotation, highlighted text is not automatically copied as a content of the annotation.
The Editor has an option "Copy selected text into Highlight, Cross-Out, and Underline comment pop-ups" on Editor's preferences "Commenting" page.

HTH
OK, thanks for the reply.
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: Highlight annotation contents

Post by Will - Tracker Supp »

:D
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Post Reply