예제 #1
0
        public static TemplateForm Create(string name_value, string form_path)
        {
            if (!File.Exists(form_path))
            {
                return(null);
            }

            TemplateForm _tfNewTemplate = new TemplateForm(name_value);

            _tfNewTemplate._sFormFile = form_path;

            if (_tfNewTemplate._bAutoImportFields)
            {
                _tfNewTemplate.import_fields();
            }

            return(_tfNewTemplate);
        }
예제 #2
0
        /// <summary>
        /// Create a template from a provided PDF form path.
        /// The new template will be automatically bind to the 'generating' form.
        /// Fields will be imported accordingly to the settings auto_import_fields parameter.
        /// </summary>
        /// <param name="name_value">Id of the new template</param>
        /// <param name="form_path">PDF form path</param>
        /// <param name="auto_import_fields">Auto import fields from pdf form (default true)</param>
        /// <returns>New template</returns>
        public static TemplateForm Create(string name_value, string form_path, bool auto_import_fields = true)
        {
            if (!File.Exists(form_path))
            {
                return(null);
            }

            TemplateForm _tfNewTemplate = new TemplateForm(name_value);

            _tfNewTemplate._sFormFile = System.IO.Path.GetFileName(form_path);

            if (auto_import_fields)
            {
                _tfNewTemplate.import_fields();
            }

            return(_tfNewTemplate);
        }