|
1. First of all, we need to create a Xpertdoc template by clicking the Convert button.
|
|
|
|
2. Then, you need to go to the Xpertdoc Properties and click on the Custom object Button to add a Custom object.
|
|
|
|
3. Add an Image Custom Object and click OK.
|

|
|
|
4. Click on the Imports/Usings Button and add a Using for the System.Drawing namespace.
|

|
|
|
5. You can now add an Xpertdoc Image to the template by clicking on the Insert Image Button.
|
|
|
|
6. Refer to the custom object you created in step 3. Use the name that you put in the Custom Object's Name Property.
|
|
|
|
7. Now, you need to compile the Xpertdoc template to get an assembly which will be referenced from the C# application. Click on the compile button to generate the assembly.
|
|
|
|
8. The assembly will be located in the Template Output folder that you can configure in the Xpertdoc Options. Click on the Options Button and look for the Template Output folder property. The name of the assembly is the name of the template with a DLL extension.
|
|
|
|
9. Start your Visual Studio project and add a reference to the assembly.
|
|
|
|
10. In the Visual Studio project, add a reference to the namespace of the template.
|
|
|
|
11. To generate the document with an image, you must first instanciate an object of the template, then assign an Image to the graphic Custom Object. Set an output stream by calling the SetOutputStream method that takes a stream as a parameter and call the Execute method to generate the document.
|
|
|
You can now open the generated document and see your image. Please note that the graphic does not come from the template but from the C# application and is passed through an Image object.
|
|