[ 
https://issues.apache.org/jira/browse/PDFBOX-3013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14950586#comment-14950586
 ] 

Maruan Sahyoun edited comment on PDFBOX-3013 at 10/10/15 6:36 AM:
------------------------------------------------------------------

Quick observation:

- elements are created if the attribute names matches potential elements within 
a specific schema.
- -there are 4 description elements in the source XMP but only 3 are retained 
(at the parsing stage they are still there)- has been explicitly deleted in the 
sample code so this is not an issue

I'd need to (re-)check with the spec if a XMP property can be specified as XML 
attribute or element or if it's always either or. (Have an answer in my head 
but need to ensure that I'm not mistaken). I've disabled creating XMP 
properties from attributes which fixes the first issue for the serialization. 
Obviously the attributes value is no longer available as an XMP property. So it 
might not be an easy one to fix as there are a number of implications :-( 
(Although we still pass all PDF/A validation tests we passed before with that 
change)



was (Author: msahyoun):
Quick observation:

- elements are created if the attribute names matches potential elements within 
a specific schema.
- there are 4 description elements in the source XMP but only 3 are retained 
(at the parsing stage they are still there)

I'd need to (re-)check with the spec if a XMP property can be specified as XML 
attribute or element or if it's always either or. (Have an answer in my head 
but need to ensure that I'm not mistaken). I've disabled creating XMP 
properties from attributes which fixes the first issue for the serialization. 
Obviously the attributes value is no longer available as an XMP property. So it 
might not be an easy one to fix as there are a number of implications :-( 
(Although we still pass all PDF/A validation tests we passed before with that 
change)


> Incorrect accordance between attributes and properties
> ------------------------------------------------------
>
>                 Key: PDFBOX-3013
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3013
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Writing, XmpBox
>    Affects Versions: 2.0.0
>            Reporter: Evgeniy Muravitskiy
>         Attachments: InfoXMP.pdf, restest.xml
>
>
> when i write code as follows:
> {code}
> 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);
> {code}
> I get xml with following tags hierarchy:
> {code}
> <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>
> {code}
> It`s happens when some properties used in attributes. If this properties in 
> source file used in tags then no problems.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to