Drag and Drop form field

Is it possible to drag and drop form fields onto a word document using the document editor in an Angular app?


https://www.syncfusion.com/kb/10292/how-to-add-drag-and-drop-text-option-in-document-editor-for-asp-net-mvc

Similar to this, but instead of text, I want form fields with predefined names that I can then run through a processor to actually fill in those form fields?


Essentially I am trying to make a template builder. 


6 Replies

LC Luke Carlson January 18, 2022 04:41 PM UTC

https://www.syncfusion.com/forums/168210/how-can-i-drag-and-drop-an-element-from-a-list-inside-document-editor


This is exactly what I need, but instead of insertText I need insertFormField and I need to be able to assign it a name from code... so without the user having to enter anything. 



TA Thanveer Ahamed Abdul Waheed Syncfusion Team January 19, 2022 02:46 PM UTC

Hi Luke,


Syncfusion Greetings!


Document editor doesn't have support drag& drop support. In application level, you can achieve your requirement using Form field API.


Here you can refer the form field documentation and API:

https://ej2.syncfusion.com/angular/documentation/document-editor/form-fields/


You can check mail merge sample for reference in which we added drag and drop field.


Sample link:

https://stackblitz.com/edit/angular-qye4ux

please let us know if you need further assistance.


Regards,

Thanveer Ahamed A



LC Luke Carlson January 19, 2022 03:29 PM UTC

That stack blitz is super helpful! Thank you! Is it possible to apply styling to the merge fields? All caps, all lower, etc.? 


Also is there similar functionality in the PDF editor? Drag and dropping form fields from a list view?



TA Thanveer Ahamed Abdul Waheed Syncfusion Team January 20, 2022 12:14 PM UTC

Hi Luke,


### That stack blitz is super helpful! Thank you! Is it possible to apply styling to the merge fields? All caps, all lower, etc.? 


Normally, field style will apply based on current selection. If you want to apply any specific style, you can use bookmark to select field and apply formatting.


Please check below sample for reference:


https://stackblitz.com/edit/zpzq5x?file=index.ts


Please let us know if you have any questions.


### Also is there similar functionality in the PDF editor? Drag and dropping form fields from a list view?


You can drag and drop the form fields using the “Add and Edit Form fields” icon present in the toolbar. We have shared the online demo and UG documentation for your reference.


Online demo: https://ej2.syncfusion.com/angular/demos/#/bootstrap5/pdfviewer/form-designer


UG documentations: https://ej2.syncfusion.com/angular/documentation/pdfviewer/form-designer/create-fillable-PDF-forms/create-programmatically/

https://ej2.syncfusion.com/angular/documentation/pdfviewer/form-designer/create-fillable-PDF-forms/create-with-user-interface-interaction/


Kindly try this and revert us, if you have any concerns.


Regards

Thanveer Ahamed A



LC Luke Carlson January 20, 2022 03:08 PM UTC

For the PDF one is it possible drag and drop from a predefined list view? Like in the word example. I'm trying to make a template builder, but I need the form fields predefined so it's not up to the user to give them names and such. 



TA Thanveer Ahamed Abdul Waheed Syncfusion Team January 21, 2022 06:11 AM UTC

Hi Luke,



Syncfusion PDF Viewer does not have support to drag and drop the form fields from the list view. As we mentioned in our previous update, you can use the Add and Edit Form fields icon in the toolbar to drag and drop the form fields in the PDF document. This is the default behavior of Syncfusion PDF Viewer.


Please revert to us, if you need further assistance.



Regards,

Thanveer Ahamed A


Loader.
Up arrow icon