TX Text Control .NET for Windows Forms

Data Property

Property|Introduced in 29.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets the file's data. It can be either a string or binary data given as an array of bytes.

Syntax

public object Data { get; }

Examples

The following example configures a PDF attachment before embedding it in a WordprocessingML document by using EmbeddedFile.Data.

EmbeddedFile embeddedFile = new("terms.pdf", @"Attachments\terms.pdf", "application/pdf");

Console.WriteLine($"Data: {embeddedFile.Data}");
Console.WriteLine("Embedded File is ready for use.");

SaveSettings saveSettings = new() { EmbeddedFiles = new[] { embeddedFile } };
textControl.Save("contract-with-attachment.docx", StreamType.WordprocessingML, saveSettings);

Limitations

Read only.