Extracting more extended properties

Hi,

When we try to extract the Extended Properties of sample file using aspose PDF version 8.3.1.0,we are getting 7839 properties from Collapsed link in below screenshot.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

But In original PDF file, It is showing only 35 Properties. Please refer the screenshot of Custom properties of original PDF File which I have attached here.

Please let us know why aspose is extracting 7839 properties?

Thanks,

Dhivya

<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />

Hi Dhivya,


Thanks for your inquriy. We will appreciate it if you please share your sample code and document here, we will look into it and guide you accordingly.

We are sorry for the inconvenience caused.

Best Regards,

Hi,

Please find the sample code and also attached sample docuemnt for your reference.

private void ExtractMetadata(Stream stream, PropertyFlags flags)

{

PdfFileInfo pdfFileinfo = new PdfFileInfo(stream);

//Custom array list

if (_items == null)

_items = new DocumentProperties();

_items.Clear();

//Extract all custom properties

foreach (DictionaryEntry entry in pdfFileinfo.Header)

{

DateTime dt = DateTime.MinValue;

string value = entry.Value.ToString();

if (DateTime.TryParse(value, out dt))

{

dt = dt.ToLocalTime();

value = dt.ToString("yyyy-MM-dd");

}

_items.Add(new DocumentProperty(entry.Key.ToString(), value, PropertyType.Object, "Custom Metadata", true));

}

}<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks,

Dhivya

Hi Dhivya,


Thanks for your inquriy. I am afraid I am unable to test your code due to missing references. However, I have tested the scenario using following code and it identify 42 properties. Please use Document.Metadata for extended properties, it will help you to accomplish the task.

Document doc = new
Document(@“Sample.pdf”);<o:p></o:p>

//PDF XMP metadata

Console.WriteLine(doc.Metadata.Count);

Please feel free to contact us for any further assistance.


Best Regards,