distinguish between field and signature

You can identify the annotation under a given point in the viewer using:

PDFViewCrtrl.GetAnnotationAt(x, y), which returns Annot (http://www.pdftron.com/pdfnet/html/classpdftron_1_1PDF_1_1Annot.html) or null.

If annot.GetType() returns e_Widget you have a filed.

A Widget annotation can be associated with a Field:

You can up-cast the Annot to a Widget as follows:

C#, JAVA, etc:

pdftron.PDF.Annots.Widget w = new pdftron.PDF.Annots.Widget (annot.GetSDFObj());

C++:

pdftron.PDF.Annots.Widget w = pdftron.PDF.Annots.Widget (annot.GetSDFObj());

then access the Field using w.GetField ().

Finally you get the type of the field with Field.GetType ()

Which can be any of the following values:

On Thursday, June 7, 2012 2:25:29 AM UTC-7, LR wrote:

Is it possible to distinguish between clicking on a form field to clicking on a signature field?
If yes, how it can be implemented?
Thanks in advance.

I assume you are talking about this in the context of PDFNet Android SDK.

Yes, you are able to achieve this easily by saving the clicking position in the current tool and then retrieve it when ToolManager.createTool() is called. For example, you can have the following code in your customized tool named MyTool:

class MyTool implements PDFViewCtrl.Tool{

public float m_click_x;
public float m_click_y;

public boolean onSingleTapConfirmed(MotionEvent e) {

//save it in the tool

m_click_x = e.getX();

m_click_y = e.getY();

}

}

Then

public class MyToolManager implements PDFViewCtrl.ToolManager{

public PDFViewCtrl.Tool createTool(int mode, PDFViewCtrl ctrl, PDFViewCtrl.Tool current_tool) {

if ( current_tool != null && current_tool instanceof MyTool ) {

//retrieve it in the tool manager

MyTool t = (MyTool)current_tool;

double cx = t.m_click_x;

double cy = t.m_click_y;

}

}

}

There is a simple tool library implementation at https://groups.google.com/forum/?fromgroups#!topic/pdfnet-sdk/fG-20n1gcPU