TX Text Control .NET for WPF

FileName Property

Property
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets or sets the corresponding file name and path from which an inserted image is loaded.

Syntax

public string FileName { get; set; }

Examples

The following example inserts and configures a named, accessible company logo by using Image.FileName.

TXTextControl.Image image = new() { FileName = @"Images\company-logo.png", Name = "CompanyLogo" };
textControl.Images.Add(image, -1);

image.FileName = @"Images\company-logo.png";
if (!string.IsNullOrWhiteSpace(image.FileName))
{
    Console.WriteLine($"File Name: {image.FileName}");
}

textControl.Save("report-with-logo.docx", StreamType.WordprocessingML);