How to C#: Tiff
Using Tiff SDK for C#.NET
Tiff Metadata Edit
  |  
Home ›› XDoc.Tiff ›› C# Tiff: Edit Tiff Metadata

C# TIFF - 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.


Related .net document control helps:
asp.net office file viewer: ASP.NET Office Word Document Viewer: view MS Office Word files online using C# in ASP.NET web applications
asp.net excel file viewer: ASP.NET Excel Document Viewer in C# Control: view office excel files online in ASP.NET web applications
asp.net iis file viewer: C# HTML5 Viewer: Deployment on IIS
asp.net dicom file viewer: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
asp.net pdf viewer control: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET
asp.net image file viewer: ASP.NET Image Document Viewer Control: view, annotate, redact, convert image files in html web browser
asp.net dnn file viewer: DNN Document Viewer Control: view, annotate, redact, convert documents in dotnetnuke ASP.NET


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.




C# Project DLLs: Edit TIFF Metadata



In order to run the following conversion code, please do as follows:


Add references;


  RasterEdge.Imaging.Basic.dll


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.XDoc.Processing.dll


  RasterEdge.Imaging.Raster.dll


  RasterEdge.Imaging.Raster.Core.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.XDoc.TIFF.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.TIFF;


Note: When you get the error "Could not load file or assembly 'RasterEdge.Imaging.Basic' or any other assembly or one of its dependencies. An attempt to load a program with an incorrect format", please check your configure as follows:


If you are using x64 libraries/dlls, Right click the project -> Properties -> Build -> Platform target: x64.


If using x86, the platform target should be x86.




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.