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

Free Support Forum - aspose.com

Extract dc metadata from pdf

Hello,

I would like to extract the dc metadata from a pdf file. Using the getByDefaultMetadataProperties, I am able to extract the creatorTool, creatorDate, ModDate, ModCreator, and Identifier, but I would like to extract all the dc metadata my document contains and this is not all of it.
So I tried using xmpMetadata.getXmpMetadata() but it returns an Object and I don’t know what to cast it into to get the right string. I also tried using xmpMetadata.getValues which seems to hold all the information I need when looking at it with the debugger but it is all obfuscated and I can’t access the data in there.

Here is my code:
PdfXmpMetadata xmpMetadata = new PdfXmpMetadata(uploadContext.document.getPdfDocument());
System.out.println("creatorTool: " + xmpMetadata.getByDefaultMetadataProperties(DefaultMetadataProperties.CreatorTool)); // OK
System.out.println("identifier: " + xmpMetadata.getByDefaultMetadataProperties(DefaultMetadataProperties.Identifier)); // OK
System.out.println("dc:format: " + xmpMetadata.getXmpMetadata(“dc:format”));// NOPE
System.out.println("dc:title: " + xmpMetadata.getXmpMetadata(“dc:title”));
System.out.println("dc:creator: " + xmpMetadata.getXmpMetadata(“dc:creator”));// NOPE
System.out.println("dc:description: " + xmpMetadata.getXmpMetadata(“dc:description”));// NOPE
System.out.println("dc:description: " + xmpMetadata.getXmpMetadata(“dc:rights”));// NOPE
System.out.println("xmp:CreatorTool: " + xmpMetadata.getXmpMetadata(“xmp:CreatorTool”)); // this does not work either

Thanks,

Camille.
Attached is an example document

Hi Camille,

Thanks for your inquiry. While testing the scenario with your shared document, we have managed to reproduce the issue with latest version of Aspose.Pdf for Java 9.7.0. We have logged a ticket PDFNEWJAVA-34663 in our issue tracking system for further investigation and resolution. We will notify you as soon as it is resolved.

We are sorry for the inconvenience caused.

Best Regards,

Any news on that?

thanks,

Camille.

Hi Camille,


Thanks
for your patience.
<o:p></o:p>

As we recently have been able to notice this issue, so development team requires little time to investigate and figure out the reasons of this problem. Nevertheless, as soon as we have made some definite progress towards its resolution, we would be more than happy to update you with the status of correction.

Our humble request is to
please be patient and spare us little time.