Skip to main content
The following code example demonstrates how to download the created document to a local directory and open it.

Code

Walk-through

The first step retrieves the document using an agent instance, DocumentAgent. The DocumentAgent.GetDocumentEntity method is invoked to get a DocumentEntity instance, which contains all properties of the document you are going to download - such as header and description. You must also provide a name for the file. This name becomes the temporary file name where the file is downloaded, built up, and opened.
Make sure the extensions of both the original and the downloaded document are the same.
Now you are ready to download the document. Use the DocumentAgent.CreateTempFile method to execute the download. The example uses the System.Diagnostics.Process class to open the file. This ensures that the default application assigned to open this file type is launched to view the document.