An existing template ID.
The tag value. Must be < 256 characters length.
Example





In This Topic
GdPicture14 Namespace / GdPictureImaging Class / ADRSetTemplateTag Method

ADRSetTemplateTag Method (GdPictureImaging)

In This Topic
Sets a TAG to an existing template. Tip: this can be the name of the Template Identifier.
Syntax
'Declaration
 
Public Function ADRSetTemplateTag( _
   ByVal TemplateID As Integer, _
   ByVal TemplateTag As String _
) As Boolean
public bool ADRSetTemplateTag( 
   int TemplateID,
   string TemplateTag
)
public function ADRSetTemplateTag( 
    TemplateID: Integer;
    TemplateTag: String
): Boolean; 
public function ADRSetTemplateTag( 
   TemplateID : int,
   TemplateTag : String
) : boolean;
public: bool ADRSetTemplateTag( 
   int TemplateID,
   string* TemplateTag
) 
public:
bool ADRSetTemplateTag( 
   int TemplateID,
   String^ TemplateTag
) 

Parameters

TemplateID
An existing template ID.
TemplateTag
The tag value. Must be < 256 characters length.

Return Value

True if success, else False (unknown template).
Example
Creating two templates and renaming a file using the name of the template which has the best similar content.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    // Create a template "A".
    int templateID = gdpictureImaging.ADRCreateTemplateFromFile(@"templateA.tif");
    gdpictureImaging.ADRSetTemplateTag(templateID, "TemplateA");
 
    // Create a template "B".
    templateID = gdpictureImaging.ADRCreateTemplateFromFile(@"templateB.tif");
    gdpictureImaging.ADRSetTemplateTag(templateID, "TemplateB");
 
    // Identify the template which has the best similar content and change the file name accordingly.
    templateID = gdpictureImaging.ADRGetCloserTemplateForFile("image.tif");
    string templateName = gdpictureImaging.ADRGetTemplateTag(templateID);
    File.Move("image.tif", templateName + "_image.tif");
 
    // Deletes all document identifier templates.
    int templateCount = gdpictureImaging.ADRGetTemplateCount();
    for (int i = 1; i <= templateCount; i++)
    {
        templateID = gdpictureImaging.ADRGetTemplateID(1);
        gdpictureImaging.ADRDeleteTemplate(templateID);
    }
}
See Also