Our Use-Case

I’m trying out if software will work for our requirements/use-case, but starting out seems this have a very high learning curve. I’m trying to run the document server through Docker but it seems there’s no built-in web-based editor, even the desktop version can’t connect to verify if my instance works fine.

Here’s the command I used:
docker run -i -t -d -p 8080:80 --restart=always -e JWT_ENABLED=false onlyoffice/documentserver

So, I think I’ll just ask here if our Use-Case will work with OnlyOffice.

We need to generate documents(mostly are legal) with pages/parts and data depends on the parameters. Like, aside from the mail-merge-like feature to fill-up some fields, we either remove certain portion or put use different format for that part depends on the combination of multiple parameter. In our current implementation, we create tons of templates, then use the templates that would fit based on the requirement, then fill-up the fields with the provided data. After that, we combine those generated files into a single PDF file for the customer to download.

In our current implementation, we encounter inconsistencies in the output, because people who prepare these templates using different versions of MS Office(we suggest to use LibreOffice but they’re really stubborn in using MS Office). Maybe if we use a web-based document editor and embed it on our web-app(Angular 2+), then use a more reliable document format(which we will enforce), we might be able to produce more consistent documents. Once the templates were created, we’ll just leave it there until we were asked to put some changes, so collaboration won’t be needed.

I’m thinking of using the Mail Merge in the API to generate documents from templates, but I don’t know if it is capable of filling-up the tables with dynamic rows, if not, what are my other options for this? Then export it to PDF. Then combine those PDFs into a single document within the application I’m developing, but maybe OnlyOffice API have this feature that I can take-advantage, but not a big deal.

If these are doable on OnlyOffice, what are the things I need to install and configure? Is Document Server enough for my requirements? We probably don’t need to track who edit the templates for now because there are only few people who prepares these files internally and we can handle the access to the page with our security implementation.

Thank you!

Hello @eSPiYa
First of all, let’s check your installation.

I’m trying to run the document server through Docker but it seems there’s no built-in web-based editor, even the desktop version can’t connect to verify if my instance works fine.

Here’s the command I used:
docker run -i -t -d -p 8080:80 --restart=always -e JWT_ENABLED=false onlyoffice/documentserver

To be honest this part isn’t clear to me. Do you see welcome page\example page when you are going to Document server domain name\IP address in a browser? It should be available, so you can check integrated example.

About your desired scenario. Do I undesrand it right that you need to build some files template and later use them for co-editing?
At first sight you can use DocBuilder methods for files building: ONLYOFFICE Api Documentation - Overview
It doesn’t have web-interface, all requests should be sent to installed Document server:
ONLYOFFICE Api Documentation - Web Document Builder API
This way you will be able to create and edit files, even to convert them to pdf.

If you need some kind of forms that your user should fill out, probably you can take a look at Automation API and this method: ONLYOFFICE Api Documentation - External access to the document editing
However, the exact usage scenario is still unclear to me. If it’s possible, please describe it step-by-step (you can draw a scheme or make screenshots). But first of all, we need to check your Document server installation, so you will be able to run tests.

Yes, I was able to access the Example part, but I’m having issues with editing them. I’m receiving a warning “The document could not be saved. Please check connection settings or contact your administrator”, then an error “Download Failed”. After more digging, it is probably because the host is Windows, although I’m using Linux containers.

About your desired scenario. Do I undesrand it right that you need to build some files template and later use them for co-editing?

Co-editing is the least feature we’re going to use. Users might co-edit the template, but not the output or generated file. The generated file will be in PDF format and editing is not allowed.

We need a dynamic document generation where pages are dependent on the data our clients provided. Here’s a sample scenario of a single document generation:

  • Depends on the country and state of the client, we will use a certain template for the cover page.
  • The next part is some sort of a waiver where the details of the client will be printed and the format will be affected by the country and state. We have multiple templates for this section that conforms to the combinations of these fields.
  • If the client provided a co-maker, this page will be included with the details of the said co-maker. The template used is affected by country and state too.
  • If the client want to insure some of the items, the breakdown page will be included with the breakdown with the amount.
  • Depends on the type and make of the dwelling, more breakdown pages will be included. And the template that will be used will depend on the type of the dwelling.
  • There are other pages will be included depends on other data that the client provided will be included.

These pages will be combined into one and the end result will be a PDF file that will be forwarded to the agent for them to print and make the client sign.

But based on the documentation, it looks like the web/REST API for document generation don’t accept data as parameters. What are our other option for this? At first, I thought we can just use the web API for mail merge and provide the data through parameters. But it seems it OnlyOffice document server API works differently.

Do you mean that you installed Document server via docker on Windows server?

About the scenario itself. It seems you need to use OFORMS, especially this method ONLYOFFICE Api Documentation - External access to the document editing
This method allows your users to fill out your templates and save them to PDF as the final result.

But based on the documentation, it looks like the web/REST API for document generation don’t accept data as parameters.

If you want to communicate with the editor from outside (your app\storage) to pass some data to the editor, you have to use the connector class: ONLYOFFICE Api Documentation - Automation API (this class is required for the method above).
Please bear in mind, that the Connector class is provided with Developer license only. If you want to test it, please ask colleagues of mine from Sales team (sales@onlyoffice.com) to provide you with a trial license with Automation API feature.

If I misunderstood the scenario, please clarify it.