You can easily add an online form to your website, making it available for filling in and downloading as PDF. Read on this post and learn how to do it.
We guess you are already familiar with our brand-new forms. If not, here is a quick reminder. Starting from version 7.0 of ONLYOFFICE Docs, you can create, edit and collaborate on online forms, let other users fill them out, and save forms as PDF.
In ONLYOFFICE forms, you work with two main formats. DOCXF is intended for creating form templates from blank or any existing DOCX file. The OFORM format is used for filling out the ready forms.
Find and open the index.html
file of your ONLYOFFICE Document Server. Then, connect it to the Document Server API. You need to specify configuration parameters for opening a form template.
<script type="text/javascript" src="http://0.0.0.0:8080/web-apps/apps/api/documents/api.js"></script> // Specify the path to the API JavaScript file. <button >Once done, a form template can be opened for editing. After editing this file, you can get the form itself. To do so, click the “Save as oform” button.
How to open OFORM for filling from website
You need to add a button which opens the form for filling. Then, add the
open_form_template()
function.<script type="text/javascript" src="http://0.0.0.0:8080/web-apps/apps/api/documents/api.js"></script> // Specify the path to the API JavaScript file. <button >Take into consideration that the
key
field is not passed to the configuration of the editors. This field will be automatically generated as a random number. This allows making all sessions of opening the form independent. So, collaboration on the OFORM file is disabled. That’s why anyone can open the form and fill it out without disturbing others.Once done, a form can be opened for filling. After filling in the fields (the required ones are highlighted with the red border), you can get a PDF file. To do so, click the “Save as PDF” button.
This website uses cookies. By continuing to browse the website you agree to our privacy policy.
our privacy policy