TX Text Control .NET for WPF

EmbeddedFile Class

Class|Introduced in 33.0
Namespace
TXTextControl.DocumentServer.PDF
Package
TXTextControl.TextControl.WPF.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXDocumentServer.dll
Install
dotnet add package TXTextControl.TextControl.WPF.SDK .NET 8 and later. For .NET Framework, reference TXDocumentServer.dll from the setup.

Description

The EmbeddedFile class represents an embedded file in a PDF document.

Syntax

public class EmbeddedFile

Examples

The following example embeds a PDF attachment and preserves its media type during WordprocessingML export.

EmbeddedFile embeddedFile = new("terms.pdf", @"Attachments\terms.pdf", "application/pdf");
SaveSettings saveSettings = new() { EmbeddedFiles = new[] { embeddedFile } };
textControl.Save("contract-with-attachment.docx", StreamType.WordprocessingML, saveSettings);

Members

Properties

PropertyDescription
BinaryDataIf the file is a binary file, this property returns the binary data. If the file is not a binary file, this property returns null.
CreationDateGets the file's creation date. When a document is saved and this property is null, the creation date of the embedded file is set to the creation date of the containing document.
DescriptionGets the file's optional description. If no description is set, this property returns null.
FileNameGets the file's name. It can include a relative or absolute path.
HasBinaryDataGets a value indicating whether the embedded file has binary data.
HasStringDataGets a value indicating whether the embedded file has text data.
LastModificationDateGets the date the file was last modified. When a document is saved and this property is null, the modification date of the embedded file is set to the modification date of the containing document.
MimeTypeGets an optional string specifying the file's type using types specified through the Multipurpose Internet Mail Extensions (MIME) specification. When a file is embedded and a type is not specified the default type application/octet-stream is used.
RelationshipPDF/A only. Gets an optional string describing the relationship of the embedded file and the containing document. This string can be a predefined value or should follow the rules for second-class names (ISO 32000-1, Annex E). Predefined values are "Source", "Data", "Alternative", "Supplement" or "Unspecified". It is null, if a relationship string is not available.
StringDataIf the file is a text file, this property returns the text data. If the file is not a text file, this property returns null.