You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2016/03/02 19:37:18 UTC

[jira] [Commented] (PDFBOX-3258) XMPBox XMPBasicSchema setters don't work if already set

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

Tilman Hausherr commented on PDFBOX-3258:
-----------------------------------------

The cause there is ComplexPropertyContainer.isSameProperty(). That one returns true if it is the same property, but what we really want is to know whether it is the same property name. Thus doesn't attempt to delete the existing (outdated) property. If we change that, then addProperty() calls removeProperty(), but it won't work: that one can only remove specific properties, not properties by name. Because of that the old property is not deleted.

I could change that, but then fetching structures like the one below will fail, only the last element is returned, so more thinking is needed, e.g. make a difference for unique and non unique properties.
{code}
 <dc:subject>
    <rdf:Bag>
       <rdf:li>PDF/X-4</rdf:li>
       <rdf:li>ISO 15930-7</rdf:li>
       <rdf:li>transparency</rdf:li>
       <rdf:li>transparency flattening</rdf:li>
       <rdf:li>OCCD (optional content)</rdf:li>
       <rdf:li>OpenType fonts</rdf:li>
       <rdf:li>JPEG2000</rdf:li>
       <rdf:li>16 bit images</rdf:li>
       <rdf:li>ICC v4 profiles</rdf:li>
       <rdf:li>smooth shades</rdf:li>
    </rdf:Bag>
 </dc:subject>
{code}


> XMPBox XMPBasicSchema setters don't work if already set
> -------------------------------------------------------
>
>                 Key: PDFBOX-3258
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3258
>             Project: PDFBox
>          Issue Type: Bug
>          Components: XmpBox
>    Affects Versions: 1.8.11, 1.8.12, 2.0.0
>            Reporter: Tilman Hausherr
>
> This is a follow-up for PDFBOX-3257 but for XMPBox.
> {code}
>         DomXmpParser xmpParser = new DomXmpParser();
>         xmpParser.setStrictParsing(false);
>         InputStream is = meta.createInputStream();
>         org.apache.xmpbox.XMPMetadata xmp = xmpParser.parse(is);
>         is.close();
>         XMPBasicSchema basic = xmp.getXMPBasicSchema();
>         Calendar createDate = basic.getCreateDate();
>         System.out.println(createDate);
>         basic.setCreateDate(new GregorianCalendar());
>         createDate = basic.getCreateDate();
>         System.out.println(createDate);
> {code}
> This outputs twice the same :-(



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org