Skip to content

Create Form Fields

Using CPDFReaderView, users can enter form mode and add form fields via touch interactions.

tsx
const pdfReaderRef = useRef<CPDFReaderView>(null);

<CPDFReaderView
  ref={pdfReaderRef}
  document={samplePDF}
  configuration={ComPDFKit.getDefaultConfig({})}
/>

await pdfReaderRef.current?.setFormCreationMode(CPDFWidgetType.TEXT_FIELD);

Exit Creation Mode

tsx
await pdfReaderRef.current?.exitFormCreationMode();

Supported Form Field Types

Type
CPDFWidgetType.TEXT_FIELD
CPDFWidgetType.CHECKBOX
CPDFWidgetType.RADIO_BUTTON
CPDFWidgetType.LISTBOX
CPDFWidgetType.COMBOBOX
CPDFWidgetType.SIGNATURES_FIELDS
CPDFWidgetType.PUSH_BUTTON