public IDictionary<string, string> ReadMetadataItems(
Stream stream,
int pageNumber
)
public:
IDictionary<String^,String^>^ ReadMetadataItems(
Stream^ stream,
int pageNumber
)
def ReadMetadataItems(self,stream,pageNumber):
stream
A Stream containing the image file from which the metadata should be read.
pageNumber
1-based index to the page number from which the metadata should be read.
Returns a Dictionary of key, value pairs for the file metadata items.
Possible values for the metadata keys:
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Color;
using Leadtools.Svg;
public void ReadMetadataItemsExample()
{
// The source file
string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "random.dxf");
using (var codecs = new RasterCodecs())
{
bool isMetadataItemsSupported;
using (var fileInfo = codecs.GetInformation(srcFileName, false))
{
Debug.WriteLine("Format {0}", (int)fileInfo.Format);
//Check if Metadata supported for the specified file format.
isMetadataItemsSupported = RasterCodecs.MetadataItemsSupported(fileInfo.Format);
Debug.WriteLine("isMetadataItemsSupported {0}", isMetadataItemsSupported);
}
if (isMetadataItemsSupported)
{
IDictionary<string, string> metadata = null;
try
{
//Read Metadata Items
metadata = codecs.ReadMetadataItems(srcFileName, 1);
}
catch (RasterException ex)
{
Debug.WriteLine(ex.Message);
}
Debug.WriteLine("Items count {0}", metadata.Count);
foreach (var item in metadata)
{
//Key Ex: RasterCodecs.FileMetadataKeyAuthor;
Debug.WriteLine("{0}: {1}", item.Key, item.Value);
}
}
}
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
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.