Saves all XMP metadata from the source XML file to the destination image file.
public void SaveXMPMetadata(string sourceFileName,string destFileName)
Public Overloads Sub SaveXMPMetadata( _ByVal sourceFileName As String, _ByVal destFileName As String _)
public:void SaveXMPMetadata(String^ sourceFileName,String^ destFileName)
sourceFileName
A String containing the source XML file from which the metadata should be read.
destFileName
A String containing the destination image filename to which the metadata should be written.
The XML file referenced by sourceFileName must contain a valid XMP Data.
The file referenced by destFileName must be a file format that supports XMP. For example PNG, PDF, JPEG, TIFF and SVG.
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 SaveXMPMetadataExample(){// The source filestring 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 Metamata 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 LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.ImageProcessing.ColorImports Leadtools.DrawingImports Leadtools.SvgPublic Shared Sub SaveXMPMetadataExample()' The source fileDim 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 RasterExceptionConsole.WriteLine(ex.Message)End TryEnd UsingEnd SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
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
