You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by ss...@apache.org on 2015/03/12 11:00:27 UTC

svn commit: r1666114 - in /xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp: ./ schemas/pdf/

Author: ssteiner
Date: Thu Mar 12 10:00:27 2015
New Revision: 1666114

URL: http://svn.apache.org/r1666114
Log:
FOP-2456: PDF VT support

Added:
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFVTAdapter.java   (with props)
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFVTXMPSchema.java   (with props)
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFXAdapter.java   (with props)
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFXXMPSchema.java   (with props)
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/XAPMMAdapter.java   (with props)
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/XAPMMXMPSchema.java   (with props)
Modified:
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPConstants.java
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/AdobePDFAdapter.java

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPConstants.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPConstants.java?rev=1666114&r1=1666113&r2=1666114&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPConstants.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPConstants.java Thu Mar 12 10:00:27 2015
@@ -47,6 +47,15 @@ public interface XMPConstants {
     /** Namespace URI for the Adobe PDF Schema */
     String ADOBE_PDF_NAMESPACE = "http://ns.adobe.com/pdf/1.3/";
 
+    /** Namespace URI for PDF X */
+    String PDF_X_IDENTIFICATION = "http://www.npes.org/pdfx/ns/id/";
+
+    /** Namespace URI for PDF VT */
+    String PDF_VT_IDENTIFICATION = "http://www.npes.org/pdfvt/ns/id/";
+
+    /** Namespace URI for XMP Media Management */
+    String XAP_MM_NAMESPACE  = "http://ns.adobe.com/xap/1.0/mm/";
+
     /**
      * Namespace URI for the PDF/A Identification Schema
      * (from the technical corrigendum 1 of ISO 19005-1:2005, note that the trailing slash

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java?rev=1666114&r1=1666113&r2=1666114&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java Thu Mar 12 10:00:27 2015
@@ -25,6 +25,9 @@ import org.apache.xmlgraphics.xmp.schema
 import org.apache.xmlgraphics.xmp.schemas.XMPBasicSchema;
 import org.apache.xmlgraphics.xmp.schemas.pdf.AdobePDFSchema;
 import org.apache.xmlgraphics.xmp.schemas.pdf.PDFAXMPSchema;
+import org.apache.xmlgraphics.xmp.schemas.pdf.PDFVTXMPSchema;
+import org.apache.xmlgraphics.xmp.schemas.pdf.PDFXXMPSchema;
+import org.apache.xmlgraphics.xmp.schemas.pdf.XAPMMXMPSchema;
 
 /**
  * This class is a registry of XMP schemas. It's implemented as a singleton.
@@ -52,6 +55,9 @@ public final class XMPSchemaRegistry {
         addSchema(new PDFAXMPSchema());
         addSchema(new XMPBasicSchema());
         addSchema(new AdobePDFSchema());
+        addSchema(new PDFXXMPSchema());
+        addSchema(new PDFVTXMPSchema());
+        addSchema(new XAPMMXMPSchema());
     }
 
     /**

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/AdobePDFAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/AdobePDFAdapter.java?rev=1666114&r1=1666113&r2=1666114&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/AdobePDFAdapter.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/AdobePDFAdapter.java Thu Mar 12 10:00:27 2015
@@ -31,6 +31,7 @@ public class AdobePDFAdapter extends XMP
     private static final String KEYWORDS = "Keywords";
     private static final String PDFVERSION = "PDFVersion";
     private static final String PRODUCER = "Producer";
+    private static final String TRAPPED = "Trapped";
 
     /**
      * Constructs a new adapter for Adobe PDF around the given metadata object.
@@ -79,4 +80,12 @@ public class AdobePDFAdapter extends XMP
         setValue(PRODUCER, value);
     }
 
+    /**
+     * Sets if the pdf has trapping information True or False
+     * @param v the value
+     */
+    public void setTrapped(String v) {
+        setValue(TRAPPED, v);
+    }
+
 }

Added: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFVTAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFVTAdapter.java?rev=1666114&view=auto
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFVTAdapter.java (added)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFVTAdapter.java Thu Mar 12 10:00:27 2015
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+package org.apache.xmlgraphics.xmp.schemas.pdf;
+
+import java.util.Date;
+
+import org.apache.xmlgraphics.xmp.Metadata;
+import org.apache.xmlgraphics.xmp.XMPSchemaAdapter;
+import org.apache.xmlgraphics.xmp.XMPSchemaRegistry;
+
+public class PDFVTAdapter extends XMPSchemaAdapter {
+    /**
+     * Constructs a new adapter for PDF/VT around the given metadata object.
+     * @param meta the underlying metadata
+     * @param namespace the namespace to access the schema (must be one of the PDF/VT schema
+     *                  namespaces)
+     */
+    public PDFVTAdapter(Metadata meta, String namespace) {
+        super(meta, XMPSchemaRegistry.getInstance().getSchema(namespace));
+    }
+
+    public void setVersion(String v) {
+        setValue("GTS_PDFVTVersion", v);
+    }
+
+    public void setModifyDate(Date modifyDate) {
+        setDateValue("GTS_PDFVTModDate", modifyDate);
+    }
+}

Propchange: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFVTAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFVTXMPSchema.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFVTXMPSchema.java?rev=1666114&view=auto
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFVTXMPSchema.java (added)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFVTXMPSchema.java Thu Mar 12 10:00:27 2015
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+package org.apache.xmlgraphics.xmp.schemas.pdf;
+
+import org.apache.xmlgraphics.xmp.Metadata;
+import org.apache.xmlgraphics.xmp.XMPConstants;
+import org.apache.xmlgraphics.xmp.XMPSchema;
+
+public class PDFVTXMPSchema extends XMPSchema {
+    public static final String NAMESPACE = XMPConstants.PDF_VT_IDENTIFICATION;
+
+    /** Creates a new schema instance for Dublin Core. */
+    public PDFVTXMPSchema() {
+        super(NAMESPACE, "pdfvtid");
+    }
+
+    /**
+     * Creates and returns an adapter for this schema around the given metadata object.
+     * @param meta the metadata object
+     * @return the newly instantiated adapter
+     */
+    public static PDFVTAdapter getAdapter(Metadata meta) {
+        return new PDFVTAdapter(meta, NAMESPACE);
+    }
+}

Propchange: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFVTXMPSchema.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFXAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFXAdapter.java?rev=1666114&view=auto
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFXAdapter.java (added)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFXAdapter.java Thu Mar 12 10:00:27 2015
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+package org.apache.xmlgraphics.xmp.schemas.pdf;
+
+import org.apache.xmlgraphics.xmp.Metadata;
+import org.apache.xmlgraphics.xmp.XMPSchemaAdapter;
+import org.apache.xmlgraphics.xmp.XMPSchemaRegistry;
+
+public class PDFXAdapter extends XMPSchemaAdapter {
+    /**
+     * Constructs a new adapter for PDF/X around the given metadata object.
+     * @param meta the underlying metadata
+     * @param namespace the namespace to access the schema (must be one of the PDF/X schema
+     *                  namespaces)
+     */
+    public PDFXAdapter(Metadata meta, String namespace) {
+        super(meta, XMPSchemaRegistry.getInstance().getSchema(namespace));
+    }
+
+    public void setVersion(String v) {
+        setValue("GTS_PDFXVersion", v);
+    }
+}

Propchange: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFXAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFXXMPSchema.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFXXMPSchema.java?rev=1666114&view=auto
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFXXMPSchema.java (added)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFXXMPSchema.java Thu Mar 12 10:00:27 2015
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+package org.apache.xmlgraphics.xmp.schemas.pdf;
+
+
+import org.apache.xmlgraphics.xmp.Metadata;
+import org.apache.xmlgraphics.xmp.XMPConstants;
+import org.apache.xmlgraphics.xmp.XMPSchema;
+
+public class PDFXXMPSchema extends XMPSchema {
+    public static final String NAMESPACE = XMPConstants.PDF_X_IDENTIFICATION;
+
+    /** Creates a new schema instance for Dublin Core. */
+    public PDFXXMPSchema() {
+        super(NAMESPACE, "pdfxid");
+    }
+
+    /**
+     * Creates and returns an adapter for this schema around the given metadata object.
+     * @param meta the metadata object
+     * @return the newly instantiated adapter
+     */
+    public static PDFXAdapter getAdapter(Metadata meta) {
+        return new PDFXAdapter(meta, NAMESPACE);
+    }
+}

Propchange: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFXXMPSchema.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/XAPMMAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/XAPMMAdapter.java?rev=1666114&view=auto
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/XAPMMAdapter.java (added)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/XAPMMAdapter.java Thu Mar 12 10:00:27 2015
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+package org.apache.xmlgraphics.xmp.schemas.pdf;
+
+import org.apache.xmlgraphics.xmp.Metadata;
+import org.apache.xmlgraphics.xmp.XMPSchemaAdapter;
+import org.apache.xmlgraphics.xmp.XMPSchemaRegistry;
+
+public class XAPMMAdapter extends XMPSchemaAdapter {
+    /**
+     * Constructs a new adapter for XAP MM around the given metadata object.
+     * @param meta the underlying metadata
+     * @param namespace the namespace to access the schema (must be one of the PDF/VT schema
+     *                  namespaces)
+     */
+    public XAPMMAdapter(Metadata meta, String namespace) {
+        super(meta, XMPSchemaRegistry.getInstance().getSchema(namespace));
+    }
+
+    public void setVersion(String v) {
+        setValue("VersionID", v);
+    }
+
+    /**
+     * The rendition class name for this resource.
+     * @param c the value
+     */
+    public void setRenditionClass(String c) {
+        setValue("RenditionClass", c);
+    }
+
+    public void setInstanceID(String v) {
+        setValue("InstanceID", v);
+    }
+
+    public void setDocumentID(String v) {
+        setValue("DocumentID", v);
+    }
+}

Propchange: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/XAPMMAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/XAPMMXMPSchema.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/XAPMMXMPSchema.java?rev=1666114&view=auto
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/XAPMMXMPSchema.java (added)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/XAPMMXMPSchema.java Thu Mar 12 10:00:27 2015
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+package org.apache.xmlgraphics.xmp.schemas.pdf;
+
+import org.apache.xmlgraphics.xmp.Metadata;
+import org.apache.xmlgraphics.xmp.XMPConstants;
+import org.apache.xmlgraphics.xmp.XMPSchema;
+
+public class XAPMMXMPSchema extends XMPSchema {
+    public static final String NAMESPACE = XMPConstants.XAP_MM_NAMESPACE;
+
+    /** Creates a new schema instance for Dublin Core. */
+    public XAPMMXMPSchema() {
+        super(NAMESPACE, "xmpMM");
+    }
+
+    /**
+     * Creates and returns an adapter for this schema around the given metadata object.
+     *
+     * @param meta the metadata object
+     * @return the newly instantiated adapter
+     */
+    public static XAPMMAdapter getAdapter(Metadata meta) {
+        return new XAPMMAdapter(meta, NAMESPACE);
+    }
+}

Propchange: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/XAPMMXMPSchema.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org