Application.CreateTemplatePackage Method

This method creates a template package for use with HotDocs Cloud Services or the HotDocs Open SDK. A template package is single compressed file containing a template and all its dependencies – component files, template manifests, browser interview support files (JavaScript and Silverlight), additional inserted or assembled templates, graphics, etc.. Template packages also contain a package manifest that describes the contents and structure of the package itself.

Syntax

void CreateTemplatePackage(string templatePath, string packagePath, HdServerFileType fileTypes, out string manifest)

Parameters Description
templatePath The full path and file name of the template to be packaged.
packagePath The full path and file name where the finished package should be created.
fileTypes The types of support files to generate and embed in the package. You must specify either HDServerFilesJavaScript alone, or HDServerFilesJavaScript | HDServerFilesSilverlight.
manifest When the method returns, this parameter will contain the package manifest (XML) that was produced. This manifest was embedded in the package itself, but its contents are returned here for convenience.

Example

The following C# example creates a template package suitable for serving both JavaScript and Silverlight browser interviews:

public class ExampleCode
{
    static void Main()
    {
        HotDocs.Application app = new HotDocs.Application();
         
        HotDocs.HDServerFileType fileTypes = HotDocs.HDServerFileType.HDServerFilesJavaScript | HotDocs.HDServerFileType.HDServerFilesSilverlight;
        string templatePath = @"C:\temp\Demo Editor List.docx";
        string packagePath = @"C:\temp\Demo Editor List.pkg";
        string manifest;
         
        app.CreateTemplatePackage(templatePath, packagePath, fileTypes, out manifest);
    }
}