Is it possible to drag and drop form fields onto a word document using the document editor in an Angular app?
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.
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.
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
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?
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/
Kindly try this and revert us, if you have any concerns.
Regards
Thanveer Ahamed A
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.
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