TX Text Control .NET Server

ImageSaveMode Property

Property|Introduced in 15.1
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

Description

Determines whether the document's images are stored through its data or through its file reference. By default images are stored through a file reference, when a file reference exists. Otherwise, if an image has been pasted from the clipboard, it is stored with its binary data. For a single image the value of this property can be overwritten with the Image.SaveMode property. The technical article Loading and Saving Images gives an overview how to export images.

Syntax

public ImageSaveMode ImageSaveMode { get; set; }

Members

ValueDescription
AutoAn image is saved with a file reference, when a file reference exists. Otherwise it is saved with its binary data.
SaveAsDataThe document's images are saved with their binary data.
SaveAsFileReferenceThe document's images are saved through file references.

Examples

The following example configures how the current document is exported to WordprocessingML by using SaveSettings.ImageSaveMode.

textControl.Text = "Quarterly results";
SaveSettings saveSettings = new();

saveSettings.ImageSaveMode = ImageSaveMode.Auto;
Console.WriteLine($"Image Save Mode used by Save Settings: {saveSettings.ImageSaveMode}");

textControl.Save("quarterly-results.docx", StreamType.WordprocessingML, saveSettings);

Further Reading