Description
when i write code as follows:
PDDocument document = PDDocument.load(DOCUMENT_FILE); DomXmpParser parser = new DomXmpParser(); XMPMetadata metadata = parser.parse(document.getDocumentCatalog().getMetadata().getStream().getUnfilteredStream()); metadata.removeSchema(metadata.getPDFIdentificationSchema()); File out = new File(OUTPUT_PATH); OutputStream res = new FileOutputStream(out); new XmpSerializer().serialize(metadata, res, true);
I get xml with following tags hierarchy:
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" CreateDate="2015-03-10T17:19:21+01:00" CreatorTool="veraPDF Test Builder" ModifyDate="2015-03-10T17:19:21+01:00" rdf:about="">
<xmp:CreateDate>2015-03-10T17:19:21+01:00</xmp:CreateDate>
<xmp:CreatorTool>veraPDF Test Builder</xmp:CreatorTool>
<xmp:ModifyDate>2015-03-10T17:19:21+01:00</xmp:ModifyDate>
</rdf:Description>
It`s happens when some properties used in attributes. If this properties in source file used in tags then no problems.