validating form fields drag and drop

1 Reply

VS Venkada Subramanian Durai Syncfusion Team October 10, 2025 02:05 PM UTC

Hi Rangita Rajakumar,

Thank you for your patience. We have prepared a sample based on your requirements. In the provided sample, we have implemented a restriction that prevents adding form fields outside the bounds of the PDF page. This is achieved by comparing the page dimensions with the field coordinates.


Please review the sample and let us know if it meets your requirements. Feel free to reach out if you have any questions or need further assistance.


Code snippet:

if (args.x + width >= pageWidth) {

        args.x = pageWidth - width - 10;

      }

      this.pdfviewerControl?.formDesignerModule.addFormField(

        this.currentFieldType as any,

        {

          bounds: { X: args.x, Y: args.y, Width: width, Height: height },

        } as TextFieldSettings

      );


Sample with restriction to add the field within PDF page


Regards,

Venkada Subramanian D


Loader.
Up arrow icon