ONLYOFFICE / DocumentBuilder

ONLYOFFICE Document Builder is powerful text, spreadsheet, presentation and PDF generating tool
https://www.onlyoffice.com/document-builder.aspx
GNU Affero General Public License v3.0
111 stars 54 forks source link

var jsVar = "123.docx"; builder. SaveFile ("docx", jsValue (jsVar)); //run error #101

Closed sdmq closed 1 month ago

sdmq commented 1 year ago

Docbuilder.exe V7.3.3 when executed docbuilder file

builder.CreateFile("docx"); var jsVar = "123.docx"; builder. SaveFile ("docx", jsValue (jsVar)); builder.CloseFile();

// run error(error: : save file error (-1073741819))

NilKu commented 1 year ago

Docbuilder.exe V7.4.0 on Windows

var a = "any text"; 
builder.CreateFile("docx");
builder.SaveFile("pdf", "d:\empty.pdf", "");
builder.CloseFile();

error (command): file not opened!

however the following script works

builder.CreateFile("docx");
builder.SaveFile("pdf", "d:\empty.pdf", "");
builder.CloseFile();
askonev commented 1 year ago

I can confirm - this is bug #59905

askonev commented 8 months ago

builder - is needed to NOT use js in the script. Then the script will be executed faster, because it will just be conversion. If js is present, it is easier to write like this (js variables are fully working)

builderJS

builderJS.CreateFile("docx");
var jsVar = "test.docx";
builderJS.SaveFile("docx", jsVar);

If you do not run the js interpreter (for faster script execution) then the correct code is

builder.CreateFile("docx");
var jsVar = "test.docx";
builder.SaveFile("docx", "jsValue(jsVar)");
Rita-Bubnova commented 1 month ago

I close this issue. Feel free to comment or reopen it if you got further questions.