# Different Ways to Store Additional Information in Documents

> TX Text Control provides several ways to store additional information in documents including document properties, custom properties and complete embedded documents. This article gives an overview of the various options and typical applications.

- **Author:** Bjoern Meyer
- **Published:** 2022-04-15
- **Modified:** 2025-11-16
- **Description:** TX Text Control provides several ways to store additional information in documents including document properties, custom properties and complete embedded documents. This article gives an overview of the various options and typical applications.
- **5 min read** (923 words)
- **Tags:**
  - ASP.NET
  - Custom Properties
  - Documents
  - Windows Forms
  - WPF
- **Web URL:** https://www.textcontrol.com/blog/2022/04/15/different-ways-to-store-additional-information-in-documents/
- **LLMs URL:** https://www.textcontrol.com/blog/2022/04/15/different-ways-to-store-additional-information-in-documents/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2022/04/15/different-ways-to-store-additional-information-in-documents/llms-full.txt

---

Besides the actual content, a document can contain additional data including meta information about the document title, tags and author information, custom key-value pairs and complete embedded documents. TX Text Control provides access to all of these settings to read and write this additional information from and to documents.

### Meta Information

Document properties, often known as meta data, are details about the document that describe or identify it. That can include information such as document title, author name, modification date, subject and specific keywords to identity or categorize the content.

In TX Text Control, meta data can be added using the SaveSettings object that is provided as a parameter in the Save method.

The following properties can be used:

| Property | Value Type | Value description |
|---|---|---|
| Author | String | Sets the document's author which will be saved in the document. |
| CreationDate | DateTime | Sets the document's creation date which will be saved in the document. |
| CreatorApplication | String | Sets the application, which has created the document. |
| DocumentKeywords | String\[\] | Sets the document's keywords which will be saved in the document. |
| DocumentSubject | String | Sets the document's subject string which will be saved in the document. |
| DocumentTitle | String | Sets the document's title that will be saved in the document. |
| LastModificationDate | DateTime | Sets the date the document is last modified. |

The following code shows how to use the *SaveSettings* to add meta data to an Office Open XML (DOCX) document:

```
TXTextControl.SaveSettings saveSettings =
    new TXTextControl.SaveSettings() {
        Author = "Susan Paul",
        CreationDate = DateTime.Now,
        CreatorApplication = "TX Text Control",
        DocumentKeywords = new string[] { "Summary", "Report" },
        DocumentSubject = "Detailed summary report 2022",
        DocumentTitle = "Sales Report 2022"
    };

textControl1.Save("output.docx", 
                  TXTextControl.StreamType.WordprocessingML, saveSettings);
```

When opening the Windows document properties dialog, the exported meta data can be seen in the property grid:

![Document Properties](https://s1-www.textcontrol.com/assets/dist/blog/2022/04/15/a/assets/document-properties.webp "Document Properties")

If the document is exported to PDF, the data can be found in the document properties dialog in Adobe Acrobat Reader:

![Document Properties](https://s1-www.textcontrol.com/assets/dist/blog/2022/04/15/a/assets/document-properties2.webp "Document Properties")

### Custom Properties

Custom properties can be created to store additional information about the document. These properties remain with a document and can be viewed by all MS Word users that open the document. Several property management servers provide data tracking capabilities to search for, sort, and track documents based on document properties.

In TX Text Control, these properties can be accessed and created using the UserDefinedPropertyDictionaryclass.

The *UserDefinedPropertyDictionary* class is used with the LoadSettings.UserDefinedDocumentPropertiesand SaveSettings.UserDefinedDocumentPropertiesproperties. Each entry in the dictionary is a key/value pair, where the key is the name of the document property and the value is the document property's value.

The following code shows how to add new custom properties to an MS Word document:

```
TXTextControl.UserDefinedPropertyDictionary userSettings =
    new TXTextControl.UserDefinedPropertyDictionary();

userSettings.Add("CustomPropertyString", "Custom property string");
userSettings.Add("CustomPropertyInt32", 123);
userSettings.Add("CustomPropertyBoolTrue", true);
userSettings.Add("CustomPropertyBoolFalse", false);
userSettings.Add("CustomPropertyDouble", 123.232);

TXTextControl.SaveSettings saveSettings = new TXTextControl.SaveSettings() {
    UserDefinedDocumentProperties = userSettings
};

textControl1.Save("output.docx",
                  TXTextControl.StreamType.WordprocessingML,
                  saveSettings);
```

When opening the advanced properties dialog in MS Word, these key/value pairs are listed:

![Document Properties](https://s1-www.textcontrol.com/assets/dist/blog/2022/04/15/a/assets/document-properties3.webp "Document Properties")

### Embedding Documents

PDF/A-3 permits the embedding of files in any format. PDF/A-3 documents allow the progression from electronic paper to an electronic container that holds the human and machine-readable versions of a document. Applications can extract the machine-readable portion of the PDF document in order to process it. A PDF/A-3 document can contain an unlimited number of embedded documents for different processes.

> **Learn more**
> 
> PDF/A-3 permits the embedding of files of any format. This article gives an overview of the advantages of PDF/A-3 as an electronic container.
> 
> [PDF/A-3: The Better Container for Electronic Documents](https://www.textcontrol.com/blog/2020/07/23/pdfa-the-better-container-for-electronic-documents/llms-full.txt)

This following sample code shows how TX Text Control can be used to attach a text file to a PDF document:

```
// create a non-UI ServerTextControl instance
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) {

  tx.Create();
  // set dummy content
  tx.Text = "PDF Document Content";

  // read the content of the attachment
  string sAttachment = System.IO.File.ReadAllText("attachment.txt");

  // create the attachement
  TXTextControl.EmbeddedFile attachment =
     new TXTextControl.EmbeddedFile(
        "attachment.txt",
        sAttachment,
        null) {
       Description = "My Text File",
       Relationship = "Unspecified",
       MIMEType = "application/txt",
       CreationDate = DateTime.Now,
     };

  // attached the embedded file
  tx.DocumentSettings.EmbeddedFiles =
     new TXTextControl.EmbeddedFile[] { attachment };

  // save as PDF/A
  tx.Save("document.pdf", TXTextControl.StreamType.AdobePDFA);
}
```

The EmbeddedFile object represents the attachment that is embedded in the PDF document. Besides the content, the file name and additional meta data can be added. The MIME type of the attachment (*application/text* in our case), a textual description, a relationship and the creation date must be provided.

The relationship is an optional string describing the relationship of the embedded file and the containing document. It 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"**.

When opening the document in Adobe Acrobat Reader, the attachment can be found in the *Attachments* side-panel.

![PDF Attachments](https://s1-www.textcontrol.com/assets/dist/blog/2022/04/15/a/assets/attachment.webp "PDF Attachments")

### Conclusion

A document is more than it's content. Additional meta data, custom properties and embedded documents help processes and workflows to find and categorize documents and to process documents automatically by embedding machine-readable content. TX Text Control provides the required functionality to create digital documents for a complete document automation process.

---

## About Bjoern Meyer

As CEO, Bjoern is the visionary behind our strategic direction and business development, bridging the gap between our customers and engineering teams. His deep passion for coding and web technologies drives the creation of innovative products. If you're at a tech conference, be sure to stop by our booth - you'll most likely meet Bjoern in person. With an advanced graduate degree (Dipl. Inf.) in Computer Science, specializing in AI, from the University of Bremen, Bjoern brings significant expertise to his role. In his spare time, Bjoern enjoys running, paragliding, mountain biking, and playing the piano.

- [LinkedIn](https://www.linkedin.com/in/bjoernmeyer/)
- [X](https://x.com/txbjoern)
- [GitHub](https://github.com/bjoerntx)

---

## Related Posts

- [TXTextControl.Markdown.Core 34.1.0-beta: Work with Full Documents, Selection, and SubTextParts](https://www.textcontrol.com/blog/2026/04/14/txtextcontrol-markdown-core-34-1-0-beta-work-with-full-documents-selection-and-subtextparts/llms.txt)
- [TX Spell .NET 11.0 SP1 is Now Available: What's New in the Latest Version](https://www.textcontrol.com/blog/2026/04/08/tx-spell-net-11-0-sp1-is-now-available/llms.txt)
- [TX Text Control 34.0 SP2 is Now Available: What's New in the Latest Version](https://www.textcontrol.com/blog/2026/02/18/tx-text-control-34-0-sp2-is-now-available/llms.txt)
- [TX Text Control 34.0 SP1 is Now Available: What's New in the Latest Version](https://www.textcontrol.com/blog/2025/12/03/tx-text-control-34-0-sp1-is-now-available/llms.txt)
- [Introducing TX Text Control 34.0: Your Next Leap in Document Processing](https://www.textcontrol.com/blog/2025/11/10/introducing-tx-text-control-34-0-your-next-leap-in-document-processing/llms.txt)
- [Sneak Peek: TX Text Control 34.0 Coming November 2025](https://www.textcontrol.com/blog/2025/10/02/sneak-peek-tx-text-control-34-0-coming-november-2025/llms.txt)
- [TX Text Control 33.0 SP3 is Now Available: What's New in the Latest Version](https://www.textcontrol.com/blog/2025/08/14/tx-text-control-33-0-sp3-is-now-available/llms.txt)
- [TX Text Control 33.0 SP2 is Now Available: What's New in the Latest Version](https://www.textcontrol.com/blog/2025/06/18/tx-text-control-33-0-sp2-is-now-available/llms.txt)
- [Document Lifecycle Optimization: Leveraging TX Text Control's Internal Format](https://www.textcontrol.com/blog/2025/05/16/document-lifecycle-optimization-leveraging-tx-text-controls-internal-format/llms.txt)
- [Expert Implementation Services for Legacy System Modernization](https://www.textcontrol.com/blog/2025/05/07/expert-implementation-services-for-legacy-system-modernization/llms.txt)
- [Service Pack Releases: What's New in TX Text Control 33.0 SP1 and 32.0 SP5](https://www.textcontrol.com/blog/2025/05/07/service-pack-releases-whats-new-in-tx-text-control-33-0-sp1-and-32-0-sp5/llms.txt)
- [Top 5 Real-World Applications for TX Text Control Document Processing Libraries](https://www.textcontrol.com/blog/2025/04/01/top-5-real-world-applications-for-tx-text-control-document-processing-libraries/llms.txt)
- [DWX Developer Week Moves to Mannheim - And Text Control Is on Board!](https://www.textcontrol.com/blog/2025/03/19/dwx-developer-week-moves-to-mannheim-and-tx-text-control-is-on-board/llms.txt)
- [The Wait is Over: TX Text Control for Linux is Officially Here](https://www.textcontrol.com/blog/2025/03/12/the-wait-is-over-tx-text-control-for-linux-is-officially-here/llms.txt)
- [Full .NET 9 Support in Text Control .NET Components for ASP.NET Core, Windows Forms, and WPF](https://www.textcontrol.com/blog/2024/11/11/full-net-9-support-in-text-control-net-components-for-asp-net-core-windows-forms-and-wpf/llms.txt)
- [Toggle Field Codes in TX Text Control](https://www.textcontrol.com/blog/2024/11/07/toggle-field-codes-in-tx-text-control/llms.txt)
- [TX Text Control 32.0 Service Pack 4 Released](https://www.textcontrol.com/blog/2024/09/02/tx-text-control-32-0-service-pack-4-released/llms.txt)
- [Service Pack 3: MailMerge Supports SVG Images](https://www.textcontrol.com/blog/2024/04/29/service-pack-3-mailmerge-supports-svg-images/llms.txt)
- [TX Text Control 32.0 Service Pack 3 Released](https://www.textcontrol.com/blog/2024/04/29/tx-text-control-32-0-service-pack-3-released/llms.txt)
- [Electronic Invoicing will Become Mandatory in Germany in 2025](https://www.textcontrol.com/blog/2024/04/10/electronic-invoicing-will-become-mandatory-in-germany-in-2025/llms.txt)
- [Inserting MergeBlocks with the DataSourceManager and Applying Table Styles in C#](https://www.textcontrol.com/blog/2024/04/09/inserting-mergeblocks-with-the-datasourcemanager-and-applying-table-styles-in-csharp/llms.txt)
- [The Power of SubTextParts: Typical Use Cases](https://www.textcontrol.com/blog/2024/02/09/the-power-of-subtextparts-typical-use-cases/llms.txt)
- [Renaming Merge Blocks and Merge Fields Programmatically in C#](https://www.textcontrol.com/blog/2024/02/08/renaming-merge-blocks-and-merge-fields-programmatically-in-csharp/llms.txt)
- [Encapsulating TX Text Control in Class Libraries](https://www.textcontrol.com/blog/2024/01/09/encapsulating-tx-text-control-in-class-libraries/llms.txt)
- [TX Text Control 32.0 SP2 Licensing Changes: Say Goodbye to licenses.licx](https://www.textcontrol.com/blog/2024/01/05/tx-text-control-32-0-sp2-licensing-changes/llms.txt)
