# EmbeddedFile Class

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

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 33.0
- **Namespace:** `TXTextControl.DocumentServer.PDF`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.DocumentServer.PDF > EmbeddedFile Class
- **1167 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/embeddedfile/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/embeddedfile/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/embeddedfile/llms-full.txt

---

### Description

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

### Syntax

```csharp
public class EmbeddedFile
```

```vbnet
Public Class EmbeddedFile
```

### Examples

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

```csharp
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);
```

```vbnet
Dim embeddedFile As New EmbeddedFile("terms.pdf", "Attachments\terms.pdf", "application/pdf")
Dim saveSettings As New SaveSettings() With { .EmbeddedFiles = New EmbeddedFile() { embeddedFile } }
textControl.Save("contract-with-attachment.docx", StreamType.WordprocessingML, saveSettings)
```

---

## In This Section

- [EmbeddedFile.BinaryData Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/embeddedfile/binarydata-property/llms-full.txt): If the file is a binary file, this property returns the binary data. If the file is not a binary file, this property returns null.
- [EmbeddedFile.CreationDate Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/embeddedfile/creationdate-property/llms-full.txt): Gets 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.
- [EmbeddedFile.Description Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/embeddedfile/description-property/llms-full.txt): Gets the file's optional description. If no description is set, this property returns null.
- [EmbeddedFile.FileName Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/embeddedfile/filename-property/llms-full.txt): Gets the file's name. It can include a relative or absolute path.
- [EmbeddedFile.HasBinaryData Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/embeddedfile/hasbinarydata-property/llms-full.txt): Gets a value indicating whether the embedded file has binary data.
- [EmbeddedFile.HasStringData Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/embeddedfile/hasstringdata-property/llms-full.txt): Gets a value indicating whether the embedded file has text data.
- [EmbeddedFile.LastModificationDate Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/embeddedfile/lastmodificationdate-property/llms-full.txt): Gets 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.
- [EmbeddedFile.MimeType Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/embeddedfile/mimetype-property/llms-full.txt): Gets 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.
- [EmbeddedFile.Relationship Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/embeddedfile/relationship-property/llms-full.txt): PDF/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.
- [EmbeddedFile.StringData Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/embeddedfile/stringdata-property/llms-full.txt): If the file is a text file, this property returns the text data. If the file is not a text file, this property returns null.

---

## Nearby

- **Previous:** [Contents.Lines.Find Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/contents-lines/find-method/llms-full.txt)
- **Next:** [EmbeddedFile.BinaryData Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/embeddedfile/binarydata-property/llms-full.txt)
