Get Annots details

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

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

Rad1
User
Posts: 108
Joined: Wed May 13, 2009 2:21 pm

Get Annots details

Post by Rad1 »

Hello,

How can I get all details of annotation position (e : Top left (x,y), buttom Down (x,y).....etc) ?

Thank you for help.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19885
Joined: Mon Jan 12, 2009 8:07 am

Re: Get Annots details

Post by Stefan - PDF-XChange »

Hi Rad1,

The getProps method gets all the properties for the selected annotation

For the full list of properties an annotation has reffer to adobe's JavaScript for Acrobat API Reference
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Get Annots details

Post by Corwin - Tracker Sup »

Here is small sample of how to get all annots rects via JS:

Code: Select all

var annots=this.getAnnots(0);
if(annots!=null)
{
   for(var i=0;i<annots.length;i++)
   {
      var props=annots[i].getProps();
		if (props!=null)
		{
			var name = props["name"];
			console.println("Name:");
			console.println(name);
		   var rectstring;
		   rectstring = props["rect"];
			console.println("Rect:");
			console.println(rectstring);
		}
   }
}
Rad1
User
Posts: 108
Joined: Wed May 13, 2009 2:21 pm

Re: Get Annots details

Post by Rad1 »

Hi,

Thank you for your response. I'm using JS to develope my application. How can I get the result of RunJavaScript Function using JS. As you know, Javascript does not support the passing of parameters by reference.

There any other alternative ?

Thank you.
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Get Annots details

Post by Corwin - Tracker Sup »

Sorry - for now we don’t have any other method for getting annots coordinates.
Rad1
User
Posts: 108
Joined: Wed May 13, 2009 2:21 pm

Re: Get Annots details

Post by Rad1 »

Ok, Hope that will be available for the next builds.

Can I intercept event when I draw a new rectangle (annotation) ?
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Get Annots details

Post by Corwin - Tracker Sup »

No, Viewer ActiveX doesn’t support such events.
Rad1
User
Posts: 108
Joined: Wed May 13, 2009 2:21 pm

Re: Get Annots details

Post by Rad1 »

mmmm :cry:

I wanted to use the PDF Xchange viewer to get OCR area in the pdf file using annotation as selector. I hope that the ocr librairy will be available as soon as possible. I'm very satisfied with your products.

Thank you.
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Get Annots details

Post by Corwin - Tracker Sup »

Well, you can get mouse events, such as Mouse Down, Mouse Move and Mouse Up, and cursor position in page coordinates, so you can make your own tool to select some rectangle on page.
miromr
User
Posts: 59
Joined: Sat May 09, 2009 3:05 pm

Re: Get Annots details

Post by miromr »

Good day
Is possible small sample how to create own selection procedure?

Thank you Miro
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19885
Joined: Mon Jan 12, 2009 8:07 am

Re: Get Annots details

Post by Stefan - PDF-XChange »

Hello Miro,

I think that your question is a bit away from the original topic - so a separate one would have been better, but could you please be a bit more specific about what exactly selection you want to do - and at what level - and we should be able to point you in the right direction.

Best,
Stefan
miromr
User
Posts: 59
Joined: Sat May 09, 2009 3:05 pm

Re: Get Annots details

Post by miromr »

Hello Stefan,
How to is possible make this functiononality:
Corwin - Tracker Sup wrote:Well, you can get mouse events, such as Mouse Down, Mouse Move and Mouse Up, and cursor position in page coordinates, so you can make your own tool to select some rectangle on page.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19885
Joined: Mon Jan 12, 2009 8:07 am

Re: Get Annots details

Post by Stefan - PDF-XChange »

Hello miromr,

You can achieve this using JavaScript - and all the cursor coordinate commands and Mouse events you need can be found in the
JavaScript for Acrobat API Reference

Best,
Stefan
miromr
User
Posts: 59
Joined: Sat May 09, 2009 3:05 pm

Re: Get Annots details

Post by miromr »

ok thank you
miro
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19885
Joined: Mon Jan 12, 2009 8:07 am

Re: Get Annots details

Post by Stefan - PDF-XChange »

:)