Initialize
Initializes the ONLYOFFICE Document Builder as a library for the application to be able to work with it. This method just sets the directory to the main Document Builder resources (icu files, etc). If this method is not called, the Document Builder will find resources from the current process directory.
note
For JS, this method is not used.
Syntax
- Python
- C++
- COM
- Java
- .Net
@classmethod
def Initialize(cls, directory: str = None)
static void Initialize(const wchar_t* sDirectory = 0);
HRESULT Initialize();
static void initialize(String directory);
static void Initialize(String^ sDirectory);
Parameters
- Python
- C++
- COM
- Java
- .Net
| Name | Type | Default | Description |
|---|---|---|---|
| directory | str | None | The path to the main Document Builder resources. |
| Name | Type | Default | Description |
|---|---|---|---|
| sDirectory | const wchar_t* | 0 | The path to the main Document Builder resources. |
Not used.
| Name | Type | Default | Description |
|---|---|---|---|
| directory | String | "" | The path to the main Document Builder resources. |
| Name | Type | Default | Description |
|---|---|---|---|
| sDirectory | String^ | null | The path to the main Document Builder resources. |
Example
- Python
- C++
- COM
- Java
- .Net
import docbuilder
docbuilder.CDocBuilder.Initialize("../documentBuilder")
builder = docbuilder.CDocBuilder()
docbuilder.CDocBuilder.Dispose()
std::wstring sWorkDirectory = NSUtils::GetBuilderDirectory();
CDocBuilder::Initialize(sWorkDirectory.c_str());
CDocBuilder oBuilder;
CDocBuilder::Dispose();
CoInitialize(NULL);
IONLYOFFICEDocBuilder* oBuilder = NULL;
oBuilder->Initialize();
oBuilder->Dispose();
CDocBuilder.initialize("");
CDocBuilder builder = new CDocBuilder();
CDocBuilder.dispose();
string workDirectory = "C:/Program Files/ONLYOFFICE/documentBuilder";
CDocBuilder.Initialize(workDirectory);
CDocBuilder oBuilder = new CDocBuilder();
CDocBuilder.Destroy();