C# TIFF Image Library
Edit TIFF Metadata in C#.NET


Allow Users to Read and Edit Metadata Stored in Tiff Image in C#.NET Application






C# Overview - View and Edit TIFF Metadata



RasterEdge .NET SDKs are built to enhance your productivity and streamline workflows. Our .NET SDKs own the most advanced & comprehensive documents and images reading and processing technologies. Among these SDKs, XDoc.Tiff for .NET has a mature imaging utility which allows Tiff image file metadata to be accessed and manipulated. In details, C# developers can integrate these Tiff file metadata manipulating features into a broad range of C#.NET projects, including reading, writing, deleting, and updating metadata. This Tiff metadata editing component supports the following metadata types.


EXIF tags


IIM (IPTC)


XMP data


Tiff tags



"Tiff Tag" refers to metadata information that is stored and saved with a Tiff document file. Tiff tag may contains information like color, size, count and value in captured Tiff image. In the following sections, you will get some C# sample codes for manipulating Tiff image metadata.



How to Get TIFF XMP Metadata in C#.NET



Use this C# sample code to get Tiff image Xmp metadata for string.




// Load your target Tiff docuemnt.
TIFFDocument doc = new TIFFDocument(@"c:\demo1.tif");

// Get Xmp metadata for string. And later, you may remove, add or update metadata.
String xmpMetadata = doc.GetXMPMetadata(0);




How to Get TIFF EXIF Metadata in C#.NET



You can get Exif tag of Tiff image by using the following sample code.




// Load your target Tiff document.
TIFFDocument doc = new TIFFDocument(@"C:\demo1.tif");

// Get the first page of Tiff document.
TIFFPage page = (TIFFPage)doc.GetPage(0);

// Get Tiff tag collection.
TagCollection collection = doc.GetTagCollection(0);

// Get Exif metadata. You can also update, remove, and add metadata.
List<EXIFField> exifMetadata = collection.ExifFields;




How to Get TIFF IPTC Metadata in C#.NET



This example is used for getting IPTC metadata in your C# program.




// Load your target Tiff document.
TIFFDocument doc = new TIFFDocument(@"C:\demo1.tif");
if (null == doc)
        throw new Exception("Fail to construct TIFF Document");

// Get Tiff tag collection.
TagCollection collection = doc.GetTagCollection(0);

// Get IPTC metadata. You can also update, remove, and add metadata.
List<IPTCField> IPTCMetadata = collection.IptcFields;



public TagCollection GetTagCollection(int pageIdx)

Description:
Get the specified page’s exif , iptc and tiff tag information.

Parameters:

Return:
Null if failed.


public String GetXMPMetadata(int pageIdx)

Description:
Get the specified page’s xmp information.

Parameters:

Return:
Null if failed.