←Select platform

ReadComments(string,int) Method


Gets all the comment fields stored in a file.

public IList<RasterCommentMetadata> ReadComments( 
   string fileName, 
   int pageNumber 
Public Overloads Function ReadComments( _ 
   ByVal fileName As String, _ 
   ByVal pageNumber As Integer _ 
) As IList(Of RasterCommentMetadata) 
- (nullable NSArray<LTRasterCommentMetadata *> *)readCommentsFromFile:(NSString *)file  
                                                                error:(NSError **)error 
IList<RasterCommentMetadata^>^ ReadComments(  
   String^ fileName, 
   int pageNumber 


A String containing the input file name.

1-based index of the page from which to read the comments.

Return Value

A collection of RasterTagMetadata containing all the comment fields information found in the file. If the file does not contain any comments, an empty collection will be returned. If the file format does not support comment fields, an exception will be thrown.


Some file formats can contain comments, and some cannot, and each file format has its own set of comment types. When you save a file, the comments in the RasterImage object can be saved in the file. The index into the array (specified using a constant) determines the type of comment.

To read a specific comment field stored in a file, use ReadComment.

This method will throw an exception if the file format does not support comments fields. To determine whether a file format supports comment fields, use CommentsSupported. You can also automatically load all the comment fields stored in a file during a load operation by setting the CodecsLoadOptions.Comments property to true. The comment fields data will be stored in the resulting image RasterImage.Comments collection.

To load all the comments stored in a stream, use ReadComments.


For an example, refer to ReadTags.


Target Platforms

Help Version 20.0.2020.4.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Codecs Assembly