Extracts all XMP metadata from the source file and saves it to the destination XML file.
public void ExtractXMPMetadata(
string sourceFileName,
string destFileName
)
Public Overloads Sub ExtractXMPMetadata( _
ByVal sourceFileName As String, _
ByVal destFileName As String _
)
public:
void ExtractXMPMetadata(
String^ sourceFileName,
String^ destFileName
)
sourceFileName
A String containing the source image file from which the metadata should be read.
destFileName
A String containing the destination filename to which the metadata should be written in XML format.
The file referenced by sourceFileName*
A String containing the source image file from which the metadata should be read.
To determine if a file format supports XMP, use MetadataItemsSupported.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Color;
using Leadtools.Svg;
using LeadtoolsExamples.Common;
public static void ExtractXMPMetadataExample()
{
// The source file
string srcFileName = Path.Combine(ImagesPath.Path, "Leadtools.pdf");
string xmlFileName = Path.Combine(ImagesPath.Path, "XMP.xml");
string dstFileName = Path.Combine(ImagesPath.Path, "cannon.jpg");
using (var codecs = new RasterCodecs())
{
try
{
//Extract XMP Metadata & save it to a XML file.
codecs.ExtractXMPMetadata(srcFileName, xmlFileName);
/*
Add/Update Metadata in the XML file using any XML parser(if needed).
*/
//Save XMP Metadata to a destination file using XML file that contains XMP Metadata.
codecs.SaveXMPMetadata(xmlFileName, dstFileName);
}
catch (RasterException ex)
{
Console.WriteLine(ex.Message);
}
}
}
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing
Imports Leadtools.ImageProcessing.Color
Imports Leadtools.Drawing
Imports Leadtools.Svg
Public Shared Sub ExtractXMPMetadataExample()
' The source file
Dim srcFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "Leadtools.pdf")
Dim xmlFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "XMP.xml")
Dim dstFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "cannon.jpg")
Using codecs As New RasterCodecs()
Try
'Extract XMP Metadata & save it to a XML file.
codecs.ExtractXMPMetadata(srcFileName, xmlFileName)
'
'Add/Update Metadata in the XML file using any XML parser(if needed).
'
'Save XMP Metadata to a destination file using XML file that contains XMP Metadata.
codecs.SaveXMPMetadata(xmlFileName, dstFileName)
Catch ex As RasterException
Console.WriteLine(ex.Message)
End Try
End Using
End Sub
Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
Products |
Support |
Feedback: ExtractXMPMetadata(String,String) Method - Leadtools.Codecs |
Introduction |
Help Version 19.0.2017.6.16
|
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.