We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Type of custom properties

How do you find the TYPE of custom properties in Slides?

The following works for all types except date. Is there a better way to do this?

int custom_ct = document_properties.getCountOfCustomProperties();
for (int i=0; i<custom_ct; i++) {
String custom_name = document_properties.getCustomPropertyName(i);
Object obj = document_properties.get_Item(custom_name);
if (obj instanceof Boolean) {System.out.println(“Got boolean:”+custom_name+" value="+obj);}
else if (obj instanceof Date) {System.out.println(“Got Date:”+custom_name+" value="+obj);}
else if (obj instanceof String) {System.out.println(“Got String:”+custom_name+" value="+obj);}
else if (obj instanceof Integer) {System.out.println(“Got int:”+custom_name+" value="+obj);}
else {
System.out.println(“Type of “+custom_name+” is unknown”);
}
}

Hi Joseph,


I have observed your comments. Please visit this documentation link for more details. This will help you to achieve requirements. Please share feedback with us if there is still an issue.

Best Regards,

Thank you - I have seen that link and example. The problem is that the example doesn’t determine the TYPE of the custom attribute. You can use the “instanceof” keyword to get all types except DATE.

This is either a bug - you are not properly casting the data you retrieve from Powerpoint - or there is another way to do it.

Note that this works for all the other types (Boolean, string, number). Only DATE is not working. Refer to sample code.

Thanks
Joe

Hi Joseph,


Can you please share sample presentation on which you tested this sample code so that we can investigate issue further in details.

Best Regards,