Run
Runs the ONLYOFFICE Document Builder executable with a script file as an argument.
note
For JS, this method is not used.
Syntax
- Python
- C++
- COM
- Java
- .Net
def Run(self, path: str) -> bool
bool Run(const wchar_t* sPath);
HRESULT Run([in] BSTR path, [out, retval] VARIANT_BOOL* result);
boolean run(String path);
bool Run(String^ sPath);
Parameters
- Python
- C++
- COM
- Java
- .Net
| Name | Type | Description |
|---|---|---|
| path | str | The path to the JS script file. |
| Name | Type | Description |
|---|---|---|
| sPath | const wchar_t* | The path to the JS script file. |
| Name | Type | Description |
|---|---|---|
| path | BSTR | The path to the JS script file. |
| result | VARIANT_BOOL* | Specifies if the operation is successful or not. |
| Name | Type | Description |
|---|---|---|
| path | String | The path to the JS script file. |
| Name | Type | Description |
|---|---|---|
| sPath | String^ | The path to the JS script file. |
Example
- Python
- C++
- COM
- Java
- .Net
import docbuilder
builder = docbuilder.CDocBuilder()
builder.Run("path-to-script.js")
std::wstring sWorkDirectory = NSUtils::GetBuilderDirectory();
CDocBuilder::Initialize(sWorkDirectory.c_str());
CDocBuilder oBuilder;
oBuilder.Run(L"path-to-script.js");
CDocBuilder::Dispose();
CoInitialize(NULL);
IONLYOFFICEDocBuilder* oBuilder = NULL;
VARIANT_BOOL b;
oBuilder->Run("path-to-script.js", &b);
oBuilder->Dispose();
CDocBuilder.initialize("");
CDocBuilder builder = new CDocBuilder();
builder.run("path-to-script.js");
CDocBuilder.dispose();
string workDirectory = "C:/Program Files/ONLYOFFICE/documentBuilder";
CDocBuilder.Initialize(workDirectory);
CDocBuilder oBuilder = new CDocBuilder();
oBuilder.Run("path-to-script.js");
CDocBuilder.Destroy();