Sets an argument in the UTF8 format to the builder class which can be trasferred to the program outside the CDocBuilder.ExecuteCommand method, i.e. either as an additional property when running ONLYOFFICE Document Builder executable file or as a part of program code, but not included into the document file script.
Name | Type | Description |
sParam | const char* | The parameter name in the UTF8 format, the value is always --argument. |
sValue | const char* | The parameter value in the UTF8 format which will be used in the document. |
Name | Type | Description | Default |
--use-doctrenderer-scheme | bool | Specifies if the doctrenderer mode is used when building a document or getting content from the editor when saving a file. | false |
--check-fonts | bool | Specifies if the system fonts are cached for faster work. | true |
--work-directory | const wchar_t* | The path to the temporary directory. | "" |
--cache-scripts | bool | Specifies if the sdkjs scripts are cached. | true |
--save-use-only-names | bool | Specifies if the destination paths are used (for server work). For example: /home/user/1.txt => /tmp/1.txt | false |
--all-fonts-path | const wchar_t* | The path to the AllFonts.js script. | "" |
--argument | const wchar_t* | The JSON argument which is sent to the global parameters of all the opened JS context. | "" |
--fonts-system | bool | Specifies if the system fonts are used. | true |
--fonts-dir | const wchar_t* | The path to the additional fonts directory (may be many records). | "" |
Once added, the argument will be available as the Argument variable with its parameter values set:
Argument.name === "ONLYOFFICE" // true
std::wstring sWorkDirectory = NSUtils::GetBuilderDirectory(); CDocBuilder::Initialize(sWorkDirectory.c_str()); CDocBuilder oBuilder; oBuilder.SetProperty("--argument", L"{\"name\":\"ONLYOFFICE\"}"); CDocBuilder::Dispose();
docbuilder.exe "--argument={\"name\":\"ONLYOFFICE\"}" test.docbuilder
It is also possible to update the font list when you either add new fonts or remove old ones. To do this, the check-fonts variable is used:
std::wstring sWorkDirectory = NSUtils::GetBuilderDirectory(); CDocBuilder::Initialize(sWorkDirectory.c_str()); CDocBuilder oBuilder; oBuilder.SetProperty("--check-fonts", L"true"); CDocBuilder::Dispose();
docbuilder.exe "--check-fonts=true" test.docbuilder