Android
ComPDFKit PDF SDK
Guides

Create & Edit Form Fields

 

Create form fields works the same as adding any other annotation, as can be seen in the guides for programmatically creating annotations.

int pageNumber = 0;
RectF pageSize = readerView.getPageNoZoomSize(pageNumber);
RectF insertRect = new RectF(0,0,100,100);
//coordinate conversion
insertRect = document.pageAtIndex(pageNumber).convertRectToPage(false,pageSize.width(),pageSize.height(),insertRect);
CPDFCheckboxWidget checkboxWidget = (CPDFCheckboxWidget) document.pageAtIndex(page).addFormWidget(CPDFWidget.WidgetType.Widget_CheckBox);
checkboxWidget.setRect(insertRect);
checkboxWidget.setChecked(true);
checkboxWidget.updateFormAp();
readerView.reloadPages();