Is it possible to select annot progmatically?

HI, I think PDFNet SDK is good solution than other solution.

I have one question.

I recommended Annot , PDFViewCtrl sample.
There is no select annot object, only text.

Is it possible to select annot progmatically. If It possible let me know how to select annot Please.

Thanks.

All annotations are available programatically. Annotations are part of pages, so you pick the page, and then the annotation. So to get the last annotation added to page 3, you would use the following code.

`
Page page = doc.GetPage(3);
if(page.GetNumAnnots() > 0)
{

Annot annot = page.GetAnnot(page.GetNumAnnots() - 1);

}

`

If you mean getting the annotation selected by the user while using PDFViewCtrl class, the exact details depends on what platform you are on. Please let me know which platform (WPF, Android, etc.) and I can advise further.

Hi Ryan,

Yes, i am trying to get User Selected Annotations, i am using PDFViewCtrl in WPF platform, Could you please guide me. i am new for pdftron.

Thanks in Advance.

Vimal

Hi Vimal,

It is a little unclear to me what you mean by user selected.
In the PDFViewWPFTest sample, you can select the annotation edit tool by clicking on the arrow icon (see attached image) in the toolbar. You can then click on annotations to select them. Is this the behaviour you are interested in?

This behaviour is part of the PDFViewWPF tools, which is another sample. You can copy this sample into your own project and use it as is. Once you create a PDFViewWPF, you have to create a ToolManager from the Tools sample and pass in the PDFViewWPF. You then need some buttons like the above ones to switch between tool modes. You can simply use ToolManager.CreateTool(ToolType.e_annot_edit) and it should now be possible to select annotations.

You can also modify the tools code however you like to suit your own program.

If you need additional help or clarification, don’t hesitate to ask.

Best Regards,

Tomas Hofmann