EmbeddedFile Class
- Namespace
TXTextControl.DocumentServer. PDF
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. Core. SDK
- Assembly
TXDocumentServer.Core. dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. Core. SDK TXDocumentServer.from the setup.dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXDocumentServer.dll
Description
The EmbeddedFile class represents an embedded file in a PDF document.
Syntax
public class EmbeddedFilePublic Class EmbeddedFileExamples
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);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)Members
Properties
| Property | Description |
|---|---|
| BinaryData | 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. |
| CreationDate | 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. |
| Description | Gets the file's optional description. If no description is set, this property returns null. |
| FileName | Gets the file's name. It can include a relative or absolute path. |
| HasBinaryData | Gets a value indicating whether the embedded file has binary data. |
| HasStringData | Gets a value indicating whether the embedded file has text data. |
| LastModificationDate | 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. |
| MimeType | 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. |
| Relationship | 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. |
| StringData | 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. |