{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "pdf-viewer-form-designer",
  "framework": "javascript",
  "type": "registry:component",
  "component": "PdfViewer",
  "variant": "form-designer",
  "dependencies": [
    "@syncfusion/ej2-pdfviewer",
    "@syncfusion/ej2-dropdowns"
  ],
  "description": "PDF viewer sample adding form fields programmatically with selectable field types.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/javascript/llms.txt",
    "skillPack": "syncfusion/javascript-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/javascript/pdf-viewer-form-designer.md"
  },
  "files": [
    {
      "target": "src/components/pdf-viewer-form-designer/pdf-viewer.html",
      "content": "<div class=\"control-section\">\n    <div class=\"content-wrapper\">\n        <div id=\"form-field-controls\" style=\"display:flex; align-items:center; gap:12px; padding:12px 0;\">\n            <label for=\"fieldType\">Form field type</label>\n            <input id=\"fieldType\" type=\"text\" />\n            <button id=\"addField\" type=\"button\">Add form field</button>\n        </div>\n        <div id=\"container\" style=\"height:calc(100vh - 280px); width:100%;\"></div>\n    </div>\n</div>\n"
    },
    {
      "target": "src/components/pdf-viewer-form-designer/pdf-viewer.ts",
      "content": "import { DropDownList } from '@syncfusion/ej2-dropdowns';\nimport {\n    Annotation,\n    BookmarkView,\n    FormDesigner,\n    FormFields,\n    LinkAnnotation,\n    Magnification,\n    Navigation,\n    PageOrganizer,\n    PdfViewer,\n    Print,\n    TextSearch,\n    TextSelection,\n    ThumbnailView,\n    Toolbar,\n    type FormFieldType\n} from '@syncfusion/ej2-pdfviewer';\n\nPdfViewer.Inject(\n    Toolbar,\n    Magnification,\n    Navigation,\n    LinkAnnotation,\n    BookmarkView,\n    ThumbnailView,\n    Print,\n    TextSelection,\n    TextSearch,\n    Annotation,\n    FormFields,\n    FormDesigner,\n    PageOrganizer\n);\n\nconst fieldTypes = [\n    { text: 'Textbox', value: 'Textbox' },\n    { text: 'Password', value: 'Password' },\n    { text: 'Checkbox', value: 'CheckBox' },\n    { text: 'Radio button', value: 'RadioButton' },\n    { text: 'Dropdown', value: 'DropDown' },\n    { text: 'List box', value: 'ListBox' },\n    { text: 'Signature', value: 'SignatureField' },\n    { text: 'Initial', value: 'InitialField' },\n    { text: 'Button', value: 'ButtonField' }\n];\n\nexport function initPdfViewerFormDesigner(): void {\n    const viewer: PdfViewer = new PdfViewer();\n    viewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf';\n    viewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/35.1.37/dist/ej2-pdfviewer-lib';\n    viewer.appendTo('#container');\n\n    const fieldTypeDropDown = new DropDownList({\n        dataSource: fieldTypes,\n        fields: { text: 'text', value: 'value' },\n        value: 'Textbox',\n        width: '180px'\n    });\n    fieldTypeDropDown.appendTo('#fieldType');\n\n    let fieldNumber = 0;\n    document.getElementById('addField')?.addEventListener('click', () => {\n        const type = fieldTypeDropDown.value as FormFieldType;\n        const row = fieldNumber % 6;\n\n        viewer.formDesigner.addFormField(type, {\n            name: `${type}_${fieldNumber + 1}`,\n            pageNumber: 1,\n            bounds: {\n                X: 100,\n                Y: 120 + row * 55,\n                Width: 220,\n                Height: 32\n            },\n            options: type === 'DropDown'\n                ? [\n                    { itemName: 'Option 1', itemValue: 'Option 1' },\n                    { itemName: 'Option 2', itemValue: 'Option 2' },\n                    { itemName: 'Option 3', itemValue: 'Option 3' }\n                ]\n                : undefined\n        });\n\n        fieldNumber++;\n    });\n}\n"
    }
  ]
}