Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 19.0.8.30
|
Leadtools.Codecs Namespace > RasterCodecs Class > SaveXMPMetadata Method : SaveXMPMetadata(String,String) Method |
public void SaveXMPMetadata( string sourceFileName, string destFileName )
'Declaration
Public Overloads Sub SaveXMPMetadata( _ ByVal sourceFileName As String, _ ByVal destFileName As String _ )
'Usage
Dim instance As RasterCodecs Dim sourceFileName As String Dim destFileName As String instance.SaveXMPMetadata(sourceFileName, destFileName)
public void SaveXMPMetadata( string sourceFileName, string destFileName )
function Leadtools.Codecs.RasterCodecs.SaveXMPMetadata(String,String)( sourceFileName , destFileName )
public: void SaveXMPMetadata( String^ sourceFileName, String^ destFileName )
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.
Imports Leadtools Imports Leadtools.Codecs Imports Leadtools.ImageProcessing Imports Leadtools.ImageProcessing.Color Imports Leadtools.Drawing Imports Leadtools.Svg Public Shared Sub SaveXMPMetadataExample() ' 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
using Leadtools; using Leadtools.Codecs; using Leadtools.ImageProcessing; using Leadtools.ImageProcessing.Color; using Leadtools.Svg; public static void SaveXMPMetadataExample() { // 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 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); } } }