For the samples to work correctly, make sure that two conditions are met:
ONLYOFFICE Document Builder is installed into default directory "C:/Program Files/ONLYOFFICE/DocumentBuilder" on your computer.
Download one of the Builder .Net samples archive and unzip it into a folder with general editing access.
Each sample includes a code folder, an sln file, and a template file if the sample uses a template.
The code folder consists of two files: a project file and a program file.
Please note that the path to the DocBuilder .dll file in the project file is set to default. Here you can change the path if DocBuilder is located in a different directory on your computer.
Include doctrenderer library .Net wrapper classes.
Specify the paths to the Document Builder work directory, the result path (where the generated file will be saved), and the optional file path (if a template file will be used).
Add .dll files to the environment.
Call the builder function (this function is created by user and calls the DocBuilder method to work with documents).
Initialize the DocBuilder from the working directory. After that Builder opens or creates a file so that Context, Scope and Global classes can be accessed.
Edit file using DocBuilder API methods. Use Call method with the name and params of the API method you call as an arguments.
Save and close file after editing, then call the Destroy method to destroy DocBuilder.
Open .sln file inside the sample folder to build the project.
Run the program when the project is built.
After program execution the result file will be saved to the result path. It's sample folder root by default.
Open result file and check the result.