public void SaveXMPMetadata(
string sourceFileName,
string destFileName
)
public:
void SaveXMPMetadata(
String^ sourceFileName,
String^ destFileName
)
def SaveXMPMetadata(self,sourceFileName,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 JPEG, TIFF and WebP.
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;
public void SaveXMPMetadataExample()
{
// The source file
string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "Leadtools.pdf");
string xmlFileName = Path.Combine(LEAD_VARS.ImagesDir, "XMP.xml");
string dstFileName = Path.Combine(LEAD_VARS.ImagesDir, "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)
{
Debug.WriteLine(ex.Message);
}
}
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS23\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.