iOS: How do I adding interactive forms support to my iOS PDF Viewer?


We are looking at an option to Render and Edit PDF Forms from within our iPad application using PDFNet SDK (

I saw some forms manipulation samples but I am not clear how to implement this in my IOS app.

A: The current iOS build includes most of the API that is available on other platforms (, and could be used to implement form filling. For example, using the forms API ( and

To determine which form or annotation is touched you can use GetAnnotationAt:y:, selector in PDFViewCtrl and PDFView:


  • Returns the annotation present at screen coordinates (x, y). If no annotation is present,
  • callling IsValid on the returned annotation will return false.
  • You must lock the doc when retrieving an annotation.
  • @param x - Number of seconds between refreshes.
  • @param y - Number of seconds between refreshes.
  • @return the annotation present at screen coordinates (x, y).
    )GetAnnotationAt: (int)x y: (int)y;

Here is a code snippet showing example usage in the context of a PDFViewCtrl:

  • (BOOL)handleTap:(UITapGestureRecognizer )gestureRecognizer

CGPoint down = [gestureRecognizer locationInView:pdfViewCtrl];

[pdfViewCtrl becomeFirstResponder];

int pn = [pdfViewCtrl GetPageNumberFromScreenPt:down.x y:down.y];

if( pn < 1 )
return NO;

PDFDoc* doc = [pdfViewCtrl GetDoc];

[doc Lock];

myAnnot = [pdfViewCtrl GetAnnotationAt:down.x y:down.y];

[doc Unlock];

If( [myAnnot IsValid] )
NSLog(@”Found a valid annotation.”);
return YES;
NSLog(@”No valid annotation.”);

return NO;