The TIFF file formats support a number of comments that are saved and loaded using predefined tags. To specify the comments or tags set them directly in the image. The RasterImage has a Tags and Comments collection for adding, removing, inserting, clearing, and getting and setting tags.
To read a comment from an existing file, use RasterCodecs.ReadComment method. To read a comment from a file at a specified location, use the version of RasterCodecs.ReadComment that takes a stream and offset. To read all comments from an existing file, use RasterCodecs.ReadComments.
Note: If an error occurred in reading all file comments using RasterCodecs.ReadComments, then no comments will be obtained, and the user is responsible to find the valid metadata in the file.
To write comments to an existing file, use RasterCodecs.WriteComments For a list of possible comments, refer to TIFF File Comments
Some restrictions apply if you use an Image File Directory (IFD) offset to indicate to which page to write a comment or tag. See the Loading And Saving Large TIFF/BigTIFF Files topic for more information.
If the comments do not meet your needs, define a custom tag for saving additional non-raster data in a TIFF file. For example, you may want to define a tag to save annotations.
The TIFF 6.0 Specification sets aside a range of private tags that developers can define. To avoid conflicts with files created by other developers, register your tag by contacting Adobe Developer Relations. (The E-Mail address posted on The Unofficial TIFF Home Page is qapdevsup@adobe.com .)
To load tagged data from a file, use the RasterCodecs.ReadTag method. To write tags to an existing file, or to change existing tags in a file, use RasterCodecs.WriteTag or RasterCodecs.WriteTags methods.
To specify whether to save metadata during file saves, call RasterCodecs.CodecsOptions.CodecsSaveOptions.Comments or RasterCodecs.CodecsOptions.CodecsSaveOptions.Tags.
Note: To write tags to a TIFF file, use RasterCodecs.WriteTags instead of using RasterImage.Tags followed by RasterCodecs.Save.
EnumTags enumerates all tags in a TIFF or Exif file. For each tag enumerated, the TagFound event is fired. Through this event, you can obtain information about, or otherwise process, each tag that is enumerated.
When modifying collections, you need to tell the RasterCodecs engine to save the tags when creating the file. Do so by calling CodecsSaveOptions.Comments or CodecsSaveOptions.Tags, whichever is appropriate. Saving the tags at the same time as the image is a far more efficient way to create files, rather than saving the image and then using the WriteTags method in a separate operation.
Delete a specified tag from a file using the DeleteTag method.
Both the Tags collection and the WriteTags method specify RasterCollections of RasterTagMetaData. Multiple tags can be written at the same time. To write private tags in a TIFF or EXIF file, refer to Working With Private TIFF Tags.
Products |
Support |
Feedback: Implementing TIFF Comments and Tags |
Introduction |
Help Version 19.0.2017.6.21
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.