Is there a way to enter the parameters collected in a document without using that API?
Short answer
Assuming that by doc (x) you refer to a .doc or .docx file, it is possible but it generally does not make sense to "reinvent the wheel".
Explanation
The .doc format is a binary format, the .docx format is a "composite" format, since it is a compressed file that includes several files of which the main ones are XML files and the rest are resources, for example, images.
On the other hand JavaScript libraries what it does is save you work, but one should take time to know its focus and scope.
If you insist on using pure JavaScript and assuming you decide to use .docx, the following is what "occurs to me" without having reviewed the documentation
- Obtain the .docx file and the data provided by the user
- Unzip the .docx file and select the main file.
- Repeat for each element:
- If the structure is known, then use select the element and insert the content provided by the user.
- If the structure is not known, there must be a map or dictionary that establishes the relationship of the data provided by the user with its location in the document.
- Compress the files in a new .docx
- Save the new .docx file
It is worth mentioning that Microsoft Word has the ability to create forms and insert fields to display both built-in and custom properties, protect the document and protect fields, etc. however, not all editors that .doc and .docx files can handle files in which these features are used, besides that this could "complicate" the code because those elements should be considered.