We checked the codes and when we try to delete all XMPBasic data. They will be set to empty before the save method. But after the file is saved, the XMPBasic data is changed back to the previous values.
Here is the pdf file and the data not removed.
pdf.PNG (31.3 KB)
DublinCore-XmpBasic -Code doc.pdf (382.7 KB)
@Glority_Developer,
Thanks for using GroupDocs.Metadata for .NET. Would you please share with us the code snippet that you are using to remove the metadata? Also, please mention the version of the API you are using at your. We’ll be looking forward to your response.
Hi, here is the code. We are using the latest API 17.9.0
format = new PdfFormat(filePath);
if (format == null)
{
return;
}
XmpEditableCollection _xmpEditableCollection = ((PdfFormat)format).XmpValues;
if (_xmpEditableCollection != null && _xmpEditableCollection.Schemes != null && _xmpEditableCollection.Schemes.XmpBasic != null)
{
_xmpEditableCollection.Schemes.XmpBasic.BaseUrl = string.Empty;
}
PdfMetadata metaData = ((PdfFormat)format).DocumentProperties;
if (metaData != null)
{
metaData.Author = string.Empty;
}
format.Save(outPath);
@Glority_Developer,
Thanks for sharing the source code with us. Please use the following code to update XMPBasic data.
var format = new PdfFormat(inputFilePath);
if (format == null)
{
return;
}
XmpBasicPackage xmpBasicPackage = format.XmpValues.Schemes.XmpBasic;
xmpBasicPackage.BaseUrl = "abc.com";
xmpBasicPackage.Nickname = "nickname";
format.Save(outputFilePath);
Hope it helps.
Thanks for the reply. Your sample codes only try to delete XMPBasic data. so it can remove XMPBasic data.
But our key problem is that when we try to delete PDF and XMPBasic at the same time, the XMPBasic cannot be removed.
@Glority_Developer,
Thanks for your response. We have successfully reproduced your reported issue at our end. We have logged it in our internal Issue Tracking System with ID: METADATANET-1940. We shall further investigate this issue and in case of any updates, we’ll notify you here.
@Glority_Developer
The issue you have found earlier (filed as METADATANET-1940) has been fixed in this update.