Good day!
How I can send array to docbuider script (not variables)?
And can I use for-each to create paragraphs for example (use array)?
I don’t find any examples…
DocumentBuilder version: 7.2.0
Installation method: deb
OS: mint
Good day!
How I can send array to docbuider script (not variables)?
And can I use for-each to create paragraphs for example (use array)?
I don’t find any examples…
DocumentBuilder version: 7.2.0
Installation method: deb
OS: mint
Hello @DmitryPozdeyev
Please clarify your request. As far as I see some docbuilder methods contain array as data type.
And can I use for-each to create paragraphs for example (use array)?
Do you mean AddText, but via array?
I use java and send parameters using bash:
/opt/onlyoffice/documentbuilder/docbuilder “–argument={“fz”:“example1”,“number”:“3474-5-1-3-021122”,“object”:“example 3”}” test.docbuilder
This work properly.
But I want to send into script, not only something like key-value… I want to send array
We are checking the situation. I’ll update this thread when we have something to share.
Probably, it will be useful. You can send array to a script this way:
docbuilder '--argument={"array":["Paragraph1","Paragraph2","Paragraph3"]}' ./test.docbuilder
As for paragraphs:
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var Array = Argument["array"];
Array.forEach(function(item, i, Array) {
var oParagraph = Api.CreateParagraph();
oParagraph.AddText(item);
oDocument.Push(oParagraph);
});
builder.SaveFile("docx", "ArgumentUse.docx");
builder.CloseFile();
Thanks! It is usefull!
Now I create dobuilder script in Java program and execute pre generate script.
We are glad that the issue is solved. Please feel free to contact us if you face any issues.
Hi, i need help to call docbuilder.exe from Java application.
I use ProcessBuilder to call the shell, but no works;
ProcessBuilder pb = new ProcessBuilder(“cmd.exe”, “/c”, “C:\Users\douglas.ferreira\Desktop\apagar\cmd-executor\src\windows\docbuilder.exe”, “replacedocument.docbuilder”);
How to implementate your caller?
The command not create my document,
If i run the command in powershell or cmd, my file is create.
Hello @DouglasEleuterio
To be honest, I’m not sure that I understand desired scenario. Would you mind providing us with details and step-by-step issue scenario.
Also you use ProcessBuilder method in your example, please point me to the ProcessBuilder documentation.