Extract ODT Metadata via .NET
Build your own .NET apps to add, edit, remove or extract metadata from Microsoft Word ODT files using server-side APIs.
How to Extract ODT Metadata Using C#
In order to extract ODT metadata, we’ll use
API which is a feature-rich, powerful and easy to use document metadata API for C# platform. Open
package manager, search for Aspose.Words and install. You may also use the following command from the Package Manager Console.
Command
PM> Install-Package Aspose.Words
Steps to Extract Metadata of ODT via C#
Extract & manipulate system or built-in properties including title, author name, statistics as well as user-defined or custom metadata stored as as name-value pairs.
- Load ODT with an instance of Document
- Get the BuiltInDocumentProperties collection of Document object
- Iterate over the collection
- Display Property Name, Type & Value
System Requirements
Before integrating the code, make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with .NET Framework, .NET Core, Windows Azure, Mono or Xamarin Platforms.
- Development environment like Microsoft Visual Studio.
- Aspose.Words for .NET referenced in your project.
Extract Metadata of ODT - C#
// load ODT file with an instance of Document
var document = new Document("template.odt");
// iterate over the BuiltInDocumentProperties collection
foreach (Aspose.Words.Properties.DocumentProperty property in document.BuiltInDocumentProperties)
{
Console.WriteLine(property.Name);
Console.WriteLine($"\tType:\t{property.Type}");
// some properties may store multiple values
if (property.Value is Array)
{
foreach (object value in property.Value as Array)
Console.WriteLine($"\tValue:\t\"{value}\"");
}
else
{
Console.WriteLine($"\tValue:\t\"{property.Value}\"");
}
}
Extract Metadata of ODT via Online App
View & edit Metadata to ODT documents by using our Live Demos with following benefits.
ODT What is ODT File Format
ODT files are type of documents created with word processing applications that are based on OpenDocument Text File format. These are created with word processor applications such as free OpenOffice Writer and can hold content such as text, images, objects and styles. The ODT file is to Writer word processor what the DOCX is to Microsoft Word. Several applications including Google Docs and Google's web-based word processor included with Google Drive can open the ODT files for editing. Microsoft Word can also open ODT files and save it in to other formats such as DOC and DOCX.
Read More