{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "pdf-viewer-form-designer",
  "framework": "angular",
  "type": "registry:component",
  "component": "PdfViewer",
  "variant": "form-designer",
  "dependencies": [
    "@syncfusion/ej2-angular-pdfviewer",
    "@syncfusion/ej2-angular-dropdowns"
  ],
  "description": "Create text, checkbox, dropdown, signature, and other form fields on the current PDF page.",
  "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/angular/llms.txt",
    "skillPack": "syncfusion/angular-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/angular/pdf-viewer-form-designer.md"
  },
  "files": [
    {
      "target": "src/components/pdf-viewer-form-designer/pdf-viewer.component.html",
      "content": "<div class=\"control-section\">\n    <div role=\"group\" aria-label=\"Form field controls\"\n        style=\"display:flex;align-items:flex-end;flex-wrap:wrap;gap:12px;margin-bottom:12px\">\n        <div style=\"width:220px\">\n            <label for=\"form-field-type\" style=\"display:block;margin-bottom:4px\">Form Field Type</label>\n            <ejs-dropdownlist id=\"form-field-type\" [dataSource]=\"fieldTypes\" [fields]=\"fieldTypeFields\"\n                [value]=\"fieldType\" [enabled]=\"isDocumentLoaded\" (change)=\"onFieldTypeChange($event)\">\n            </ejs-dropdownlist>\n        </div>\n        <button class=\"e-btn e-primary\" type=\"button\" (click)=\"addFormField()\" [disabled]=\"!isDocumentLoaded\">\n            Add Form Field\n        </button>\n    </div>\n    <p role=\"status\">\n        {{ isDocumentLoaded ? 'Adds the selected field to the currently displayed page.' : 'Loading PDF document...' }}\n    </p>\n    <ejs-pdfviewer #pdfviewer id=\"form-designer-viewer\" [documentPath]=\"document\" [resourceUrl]=\"resource\"\n        (documentLoad)=\"onDocumentLoad()\" style=\"height:640px;display:block\">\n    </ejs-pdfviewer>\n</div>\n"
    },
    {
      "target": "src/components/pdf-viewer-form-designer/pdf-viewer.component.ts",
      "content": "import { Component, ViewChild } from '@angular/core';\nimport {\n    AnnotationService,\n    BookmarkViewService,\n    FormDesignerService,\n    FormFieldsService,\n    LinkAnnotationService,\n    MagnificationService,\n    NavigationService,\n    PageOrganizerService,\n    PdfViewerComponent,\n    PdfViewerModule,\n    PrintService,\n    TextSearchService,\n    TextSelectionService,\n    ThumbnailViewService,\n    ToolbarService\n} from '@syncfusion/ej2-angular-pdfviewer';\nimport { ChangeEventArgs, DropDownListModule } from '@syncfusion/ej2-angular-dropdowns';\n\ntype FormFieldType = Parameters<PdfViewerComponent['formDesigner']['addFormField']>[0];\ntype FormFieldModel = Parameters<PdfViewerComponent['formDesigner']['addFormField']>[1];\n\n@Component({\n    selector: 'control-content',\n    templateUrl: 'pdf-viewer.component.html',\n    providers: [\n        LinkAnnotationService, BookmarkViewService, MagnificationService, ThumbnailViewService,\n        ToolbarService, NavigationService, TextSearchService, TextSelectionService, PrintService,\n        AnnotationService, FormFieldsService, FormDesignerService, PageOrganizerService\n    ],\n    standalone: true,\n    imports: [PdfViewerModule, DropDownListModule]\n})\nexport class FormDesignerComponent {\n    @ViewChild('pdfviewer')\n    public pdfviewerControl!: PdfViewerComponent;\n\n    public readonly resource = 'https://cdn.syncfusion.com/ej2/35.1.37/dist/ej2-pdfviewer-lib';\n    public readonly document = 'https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf';\n    public readonly fieldTypes: { text: string; value: FormFieldType }[] = [\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    public readonly fieldTypeFields = { text: 'text', value: 'value' };\n    public fieldType: FormFieldType = 'Textbox';\n    public isDocumentLoaded = false;\n    private fieldNumber = 0;\n\n    public onDocumentLoad(): void {\n        this.isDocumentLoaded = true;\n    }\n\n    public onFieldTypeChange(event: ChangeEventArgs): void {\n        if (typeof event.value === 'string') {\n            this.fieldType = event.value as FormFieldType;\n        }\n    }\n\n    public addFormField(): void {\n        if (!this.isDocumentLoaded) {\n            return;\n        }\n\n        const currentField = this.fieldNumber++;\n        const settings: FormFieldModel = {\n            name: `${this.fieldType}_${currentField + 1}`,\n            pageNumber: this.pdfviewerControl.currentPageNumber,\n            bounds: {\n                X: 100 + (currentField % 2) * 240,\n                Y: 120 + (Math.floor(currentField / 2) % 8) * 55,\n                Width: 200,\n                Height: 32\n            },\n            ...(this.fieldType === 'DropDown' || this.fieldType === 'ListBox'\n                ? {\n                    options: [\n                        { itemName: 'Option 1', itemValue: 'Option 1' },\n                        { itemName: 'Option 2', itemValue: 'Option 2' },\n                        { itemName: 'Option 3', itemValue: 'Option 3' }\n                    ]\n                }\n                : {})\n        };\n        this.pdfviewerControl.formDesigner.addFormField(this.fieldType, settings);\n    }\n}\n"
    }
  ]
}