You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ga...@apache.org on 2013/11/01 15:34:20 UTC

svn commit: r1537948 [3/3] - in /xmlgraphics/fop/trunk: ./ src/documentation/intermediate-format-ng/ src/java/org/apache/fop/area/ src/java/org/apache/fop/fo/ src/java/org/apache/fop/fo/extensions/ src/java/org/apache/fop/layoutmgr/ src/java/org/apache...

Added: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFNavigatorExtension.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFNavigatorExtension.java?rev=1537948&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFNavigatorExtension.java (added)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFNavigatorExtension.java Fri Nov  1 14:34:18 2013
@@ -0,0 +1,30 @@
+/*
+ * 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.fop.render.pdf.extensions;
+
+// CSOFF: LineLengthCheck
+
+public class PDFNavigatorExtension extends PDFDictionaryExtension {
+
+    PDFNavigatorExtension() {
+        super(PDFDictionaryType.Navigator);
+    }
+
+}

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFNavigatorExtension.java
------------------------------------------------------------------------------
    svn:eol-style = LF

Added: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFObjectExtension.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFObjectExtension.java?rev=1537948&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFObjectExtension.java (added)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFObjectExtension.java Fri Nov  1 14:34:18 2013
@@ -0,0 +1,101 @@
+/*
+ * 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.fop.render.pdf.extensions;
+
+import org.apache.fop.util.XMLUtil;
+
+// CSOFF: LineLengthCheck
+
+public class PDFObjectExtension {
+
+    private PDFObjectType type;
+    private Object value;
+
+    PDFObjectExtension(PDFObjectType type) {
+        this.type = type;
+    }
+
+    public PDFObjectType getType() {
+        return type;
+    }
+
+    public void setValue(Object value) {
+        this.value = value;
+    }
+
+    public Object getValue() {
+        return value;
+    }
+
+    /**
+     * Obtain entry value as Boolean.
+     * @return entry value
+     */
+    public Boolean getValueAsBoolean() {
+        Object value = getValue();
+        if (value instanceof Boolean) {
+            return (Boolean) value;
+        } else if (value instanceof String) {
+            return Boolean.valueOf((String)value);
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Obtain entry value as Number.
+     * @return entry value
+     */
+    public Number getValueAsNumber() {
+        Object value = getValue();
+        if (value instanceof Number) {
+            return (Number) value;
+        } else if (value instanceof String) {
+            double d = Double.parseDouble((String) value);
+            if (Math.abs(Math.floor(d) - d) < 1E-10) {
+                return Long.valueOf((long) d);
+            } else {
+                return Double.valueOf(d);
+            }
+        } else {
+            return Integer.valueOf(0);
+        }
+    }
+
+    public String getValueAsString() {
+        Object value = getValue();
+        if (value == null) {
+            return null;
+        } else if (value instanceof String) {
+            return (String) value;
+        } else {
+            return value.toString();
+        }
+    }
+
+    public String getValueAsXMLEscapedString() {
+        return XMLUtil.escape(getValueAsString());
+    }
+
+    public String getElementName() {
+        return type.elementName();
+    }
+
+}

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFObjectExtension.java
------------------------------------------------------------------------------
    svn:eol-style = LF

Copied: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFObjectType.java (from r1537941, xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFDictionaryEntryType.java)
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFObjectType.java?p2=xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFObjectType.java&p1=xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFDictionaryEntryType.java&r1=1537941&r2=1537948&rev=1537948&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFDictionaryEntryType.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFObjectType.java Fri Nov  1 14:34:18 2013
@@ -22,24 +22,27 @@ package org.apache.fop.render.pdf.extens
 // CSOFF: LineLengthCheck
 
 /**
- * Enumeration type for leaf PDF dictionary entry extension elements.
+ * Enumeration type for leaf PDF object extension types used as singletons,
+ * dictionary entries, or array entries.
  */
-public enum PDFDictionaryEntryType {
-    Boolean("boolean"),         // boolean valued entry
-    Dictionary("dictionary"),   // dictionary valued entry
-    Name("name"),               // name valued entry
-    Number("number"),           // number valued entry
-    String("string");           // string valued entry
+public enum PDFObjectType {
+    Array("array"),                     // array valued entry
+    Boolean("boolean"),                 // boolean valued entry
+    Dictionary("dictionary"),           // dictionary valued entry
+    Name("name"),                       // name valued entry
+    Number("number"),                   // number valued entry
+    Reference("reference"),             // indirect object reference entry
+    String("string");                   // string valued entry
 
     private String elementName;
-    PDFDictionaryEntryType(String elementName) {
+    PDFObjectType(String elementName) {
         this.elementName = elementName;
     }
     public String elementName() {
         return elementName;
     }
-    static PDFDictionaryEntryType valueOfElementName(String elementName) {
-        for (PDFDictionaryEntryType type : values()) {
+    static PDFObjectType valueOfElementName(String elementName) {
+        for (PDFObjectType type : values()) {
             if (type.elementName.equals(elementName)) {
                 return type;
             }
@@ -48,7 +51,8 @@ public enum PDFDictionaryEntryType {
     }
     static boolean hasValueOfElementName(String elementName) {
         try {
-            return valueOfElementName(elementName) != null;
+            valueOfElementName(elementName);
+            return true;
         } catch (Exception e) {
             return false;
         }

Added: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFPageElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFPageElement.java?rev=1537948&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFPageElement.java (added)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFPageElement.java Fri Nov  1 14:34:18 2013
@@ -0,0 +1,64 @@
+/*
+ * 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.fop.render.pdf.extensions;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.Constants;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.PropertyList;
+
+// CSOFF: LineLengthCheck
+
+/**
+ * Extension element for pdf:page.
+ */
+public class PDFPageElement extends PDFDictionaryElement {
+
+    public static final String ATT_PAGE_NUMBERS = PDFDictionaryExtension.PROPERTY_PAGE_NUMBERS;
+
+    /**
+     * Main constructor
+     * @param parent parent FO node
+     */
+    PDFPageElement(FONode parent) {
+        super(parent, PDFDictionaryType.Page);
+    }
+
+    @Override
+    public void processNode(String elementName, Locator locator, Attributes attlist, PropertyList propertyList) throws FOPException {
+        super.processNode(elementName, locator, attlist, propertyList);
+        String pageNumbers = attlist.getValue(ATT_PAGE_NUMBERS);
+        if (pageNumbers != null) {
+            getDictionaryExtension().setProperty(PDFDictionaryExtension.PROPERTY_PAGE_NUMBERS, pageNumbers);
+        }
+    }
+
+    @Override
+    public void startOfNode() throws FOPException {
+        super.startOfNode();
+        if (parent.getNameId() != Constants.FO_SIMPLE_PAGE_MASTER) {
+            invalidChildError(getLocator(), parent.getName(), getNamespaceURI(), getName(), "rule.childOfSPM");
+        }
+    }
+
+}

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFPageElement.java
------------------------------------------------------------------------------
    svn:eol-style = LF

Added: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFPageExtension.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFPageExtension.java?rev=1537948&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFPageExtension.java (added)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFPageExtension.java Fri Nov  1 14:34:18 2013
@@ -0,0 +1,73 @@
+/*
+ * 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.fop.render.pdf.extensions;
+
+// CSOFF: LineLengthCheck
+
+public class PDFPageExtension extends PDFDictionaryExtension {
+
+    public static final String PROPERTY_PAGE_NUMBERS = "page-numbers";
+
+    PDFPageExtension() {
+        super(PDFDictionaryType.Page);
+    }
+
+    /**
+     * Determine if page dictionary and page number matches.
+     * @param pageNumber page number, where first page number is 1
+     * @return true if this dictionary is a page dictionary and specified page number matches specified page-number property
+     */
+    public boolean matchesPageNumber(int pageNumber) {
+        String pageNumbers = getProperty(PROPERTY_PAGE_NUMBERS);
+        if ((pageNumbers == null) || (pageNumbers.length() == 0)) {
+            return false;
+        } else if (pageNumbers.equals("*")) {
+            return true;
+        } else {
+            for (String interval : pageNumbers.split("\\s*,\\s*")) {
+                String[] components = interval.split("\\s*-\\s*");
+                if (components.length < 1) {
+                    continue;
+                } else {
+                    try {
+                        int start = Integer.parseInt(components[0]);
+                        int end = 0;
+                        if (components.length > 1) {
+                            if (!components[1].equals("LAST")) {
+                                end = Integer.parseInt(components[1]);
+                            }
+                        }
+                        if ((end == 0) && (pageNumber == start)) {
+                            return true;
+                        } else if ((end > start) && (pageNumber >= start) && (pageNumber < end)) {
+                            return true;
+                        } else {
+                            continue;
+                        }
+                    } catch (NumberFormatException e) {
+                        continue;
+                    }
+                }
+            }
+        }
+        return false;
+    }
+
+}

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFPageExtension.java
------------------------------------------------------------------------------
    svn:eol-style = LF

Added: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFReferenceElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFReferenceElement.java?rev=1537948&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFReferenceElement.java (added)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFReferenceElement.java Fri Nov  1 14:34:18 2013
@@ -0,0 +1,58 @@
+/*
+ * 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.fop.render.pdf.extensions;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.PropertyList;
+
+// CSOFF: LineLengthCheck
+
+/**
+ * Extension element for pdf:reference.
+ */
+public class PDFReferenceElement extends PDFCollectionEntryElement {
+
+    public static final String ATT_REFID = PDFReferenceExtension.PROPERTY_REFID;
+
+    /**
+     * Main constructor
+     * @param parent parent FO node
+     */
+    PDFReferenceElement(FONode parent) {
+        super(parent, PDFObjectType.Reference);
+    }
+
+    @Override
+    public void processNode(String elementName, Locator locator, Attributes attlist, PropertyList propertyList) throws FOPException {
+        super.processNode(elementName, locator, attlist, propertyList);
+        String refid = attlist.getValue(ATT_REFID);
+        if (refid == null) {
+            missingPropertyError(ATT_REFID);
+        } else if (refid.length() == 0) {
+            invalidPropertyValueError(ATT_REFID, refid, null);
+        } else {
+            ((PDFReferenceExtension) getExtension()).setReferenceId(refid);
+        }
+    }
+}

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFReferenceElement.java
------------------------------------------------------------------------------
    svn:eol-style = LF

Added: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFReferenceExtension.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFReferenceExtension.java?rev=1537948&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFReferenceExtension.java (added)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFReferenceExtension.java Fri Nov  1 14:34:18 2013
@@ -0,0 +1,61 @@
+/*
+ * 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.fop.render.pdf.extensions;
+
+// CSOFF: LineLengthCheck
+
+public class PDFReferenceExtension extends PDFCollectionEntryExtension {
+
+    public static final String PROPERTY_REFID = "refid";
+
+    private String refid;
+    private Object resolvedReference;
+
+    PDFReferenceExtension() {
+        super(PDFObjectType.Reference);
+    }
+
+    @Override
+    public void setValue(Object value) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Object getValue() {
+        return this;
+    }
+
+    public String getReferenceId() {
+        return refid;
+    }
+
+    public void setReferenceId(String refid) {
+        this.refid = refid;
+    }
+
+    public Object getResolvedReference() {
+        return resolvedReference;
+    }
+
+    public void setResolvedReference(Object resolvedReference) {
+        this.resolvedReference = resolvedReference;
+    }
+
+}

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFReferenceExtension.java
------------------------------------------------------------------------------
    svn:eol-style = LF

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSPainter.java?rev=1537948&r1=1537947&r2=1537948&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSPainter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSPainter.java Fri Nov  1 14:34:18 2013
@@ -116,7 +116,7 @@ public class PSPainter extends AbstractI
     }
 
     /** {@inheritDoc} */
-    public void startGroup(AffineTransform transform) throws IFException {
+    public void startGroup(AffineTransform transform, String layer) throws IFException {
         try {
             PSGenerator generator = getGenerator();
             saveGraphicsState();

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/txt/TXTRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/txt/TXTRenderer.java?rev=1537948&r1=1537947&r2=1537948&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/txt/TXTRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/txt/TXTRenderer.java Fri Nov  1 14:34:18 2013
@@ -583,6 +583,14 @@ public class TXTRenderer extends Abstrac
     }
 
     /** {@inheritDoc} */
+    protected void startLayer(String layer) {
+    }
+
+    /** {@inheritDoc} */
+    protected void endLayer() {
+    }
+
+    /** {@inheritDoc} */
     protected void concatenateTransformationMatrix(AffineTransform at) {
         currentState.push(new CTM(UnitConv.ptToMpt(at)));
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java?rev=1537948&r1=1537947&r2=1537948&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java Fri Nov  1 14:34:18 2013
@@ -545,6 +545,16 @@ public class XMLRenderer extends Abstrac
         //only necessary for graphical output
     }
 
+    /** {@inheritDoc} */
+    protected void startLayer(String layer) {
+        //only necessary for graphical output
+    }
+
+    /** {@inheritDoc} */
+    protected void endLayer() {
+        //only necessary for graphical output
+    }
+
     /**
      * {@inheritDoc}
      *          org.apache.fop.area.inline.InlineArea)

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/util/AbstractPaintingState.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/util/AbstractPaintingState.java?rev=1537948&r1=1537947&r2=1537948&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/util/AbstractPaintingState.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/util/AbstractPaintingState.java Fri Nov  1 14:34:18 2013
@@ -24,7 +24,6 @@ import java.awt.geom.AffineTransform;
 import java.io.Serializable;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Stack;
 
@@ -36,10 +35,10 @@ public abstract class AbstractPaintingSt
     private static final long serialVersionUID = 5998356138437094188L;
 
     /** current state data */
-    private AbstractData data = null;
+    private AbstractData data;
 
     /** the state stack */
-    private StateStack/*<AbstractData>*/ stateStack = new StateStack/*<AbstractData>*/();
+    private StateStack<AbstractData> stateStack = new StateStack<AbstractData>();
 
     /**
      * Instantiates a new state data object
@@ -216,8 +215,7 @@ public abstract class AbstractPaintingSt
      */
     public AffineTransform getTransform() {
        AffineTransform at = new AffineTransform();
-       for (Iterator iter = stateStack.iterator(); iter.hasNext();) {
-           AbstractData data = (AbstractData)iter.next();
+       for (AbstractData data : stateStack) {
            AffineTransform stackTrans = data.getTransform();
            at.concatenate(stackTrans);
        }
@@ -249,7 +247,7 @@ public abstract class AbstractPaintingSt
        if (stateStack.isEmpty()) {
            return null;
        } else {
-           AbstractData baseData = (AbstractData)stateStack.get(0);
+           AbstractData baseData = stateStack.get(0);
            return (AffineTransform) baseData.getTransform().clone();
        }
     }
@@ -297,7 +295,7 @@ public abstract class AbstractPaintingSt
      */
     public AbstractData restore() {
         if (!stateStack.isEmpty()) {
-            setData((AbstractData)stateStack.pop());
+            setData(stateStack.pop());
             return this.data;
         } else {
             return null;
@@ -310,12 +308,11 @@ public abstract class AbstractPaintingSt
      *
      * @param dataList a state data list
      */
-    public void saveAll(List/*<AbstractData>*/ dataList) {
-        Iterator it = dataList.iterator();
-        while (it.hasNext()) {
+    public void saveAll(List<AbstractData> dataList) {
+        for (AbstractData data : dataList) {
             // save current data on stack
             save();
-            setData((AbstractData)it.next());
+            setData(data);
         }
     }
 
@@ -325,8 +322,8 @@ public abstract class AbstractPaintingSt
      *
      * @return a list of state data popped from the stack
      */
-    public List/*<AbstractData>*/ restoreAll() {
-        List/*<AbstractData>*/ dataList = new java.util.ArrayList/*<AbstractData>*/();
+    public List<AbstractData> restoreAll() {
+        List<AbstractData> dataList = new java.util.ArrayList<AbstractData>();
         AbstractData data;
         while (true) {
             data = getData();
@@ -361,7 +358,7 @@ public abstract class AbstractPaintingSt
      *
      * @return the state stack
      */
-    protected Stack/*<AbstractData>*/ getStateStack() {
+    protected Stack<AbstractData> getStateStack() {
         return this.stateStack;
     }
 
@@ -369,8 +366,10 @@ public abstract class AbstractPaintingSt
     @Override
     public Object clone() {
         AbstractPaintingState state = instantiate();
-        state.stateStack = new StateStack(this.stateStack);
-        state.data = (AbstractData)this.data.clone();
+        state.stateStack = new StateStack<AbstractData>(this.stateStack);
+        if (this.data != null) {
+            state.data = (AbstractData)this.data.clone();
+        }
         return state;
     }
 
@@ -385,7 +384,7 @@ public abstract class AbstractPaintingSt
     /**
      * A stack implementation which holds state objects
      */
-    public class StateStack extends java.util.Stack {
+    public class StateStack<E> extends java.util.Stack<E> {
 
         private static final long serialVersionUID = 4897178211223823041L;
 
@@ -393,7 +392,6 @@ public abstract class AbstractPaintingSt
          * Default constructor
          */
         public StateStack() {
-            super();
         }
 
         /**
@@ -419,25 +417,28 @@ public abstract class AbstractPaintingSt
         private static final long serialVersionUID = 5208418041189828624L;
 
         /** The current color */
-        protected Color color = null;
+        protected Color color;
 
         /** The current background color */
-        protected Color backColor = null;
+        protected Color backColor;
 
         /** The current font name */
-        protected String fontName = null;
+        protected String fontName;
 
         /** The current font size */
-        protected int fontSize = 0;
+        protected int fontSize;
 
         /** The current line width */
-        protected float lineWidth = 0;
+        protected float lineWidth;
 
         /** The dash array for the current basic stroke (line type) */
-        protected float[] dashArray = null;
+        protected float[] dashArray;
 
         /** The current transform */
-        protected AffineTransform transform = null;
+        protected AffineTransform transform;
+
+        /** The current (optional content group) layer. */
+        protected String layer;
 
         /**
          * Returns a newly create data object
@@ -485,6 +486,18 @@ public abstract class AbstractPaintingSt
             transform = new AffineTransform();
         }
 
+        public void setLayer(String layer) {
+            if (layer != null) {
+                this.layer = layer;
+            } else {
+                throw new IllegalArgumentException();
+            }
+        }
+
+        public String getLayer() {
+            return this.layer;
+        }
+
         /**
          * Returns the derived rotation from the current transform
          *
@@ -523,6 +536,7 @@ public abstract class AbstractPaintingSt
                 this.transform = new AffineTransform();
             }
             data.transform = new AffineTransform(this.transform);
+            data.layer = this.layer;
             return data;
         }
 
@@ -535,7 +549,8 @@ public abstract class AbstractPaintingSt
                 + ", fontSize=" + fontSize
                 + ", lineWidth=" + lineWidth
                 + ", dashArray=" + dashArray
-                + ", transform=" + transform;
+                + ", transform=" + transform
+                + ", layer=" + layer;
         }
     }
 }

Modified: xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/svg/SVGPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/svg/SVGPainter.java?rev=1537948&r1=1537947&r2=1537948&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/svg/SVGPainter.java (original)
+++ xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/svg/SVGPainter.java Fri Nov  1 14:34:18 2013
@@ -146,16 +146,16 @@ public class SVGPainter extends Abstract
     }
 
     /** {@inheritDoc} */
-    public void startGroup(AffineTransform[] transforms) throws IFException {
-        startGroup(SVGUtil.formatAffineTransformsMptToPt(transforms));
+    public void startGroup(AffineTransform[] transforms, String layer) throws IFException {
+        startGroup(SVGUtil.formatAffineTransformsMptToPt(transforms), layer);
     }
 
     /** {@inheritDoc} */
-    public void startGroup(AffineTransform transform) throws IFException {
-        startGroup(SVGUtil.formatAffineTransformMptToPt(transform));
+    public void startGroup(AffineTransform transform, String layer) throws IFException {
+        startGroup(SVGUtil.formatAffineTransformMptToPt(transform), layer);
     }
 
-    private void startGroup(String transform) throws IFException {
+    private void startGroup(String transform, String layer) throws IFException {
         try {
             AttributesImpl atts = new AttributesImpl();
             if (transform != null && transform.length() > 0) {

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=1537948&r1=1537947&r2=1537948&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Fri Nov  1 14:34:18 2013
@@ -58,7 +58,10 @@
       users, i.e. when the behaviour changes and could affect the layout of existing
       documents. Example: the fix of marks layering will be such a case when it's done.
     -->
-    <release version="FOP Trunk" date="TBD">
+    <release version="FOP Trunk" date="01 November 2013">
+      <action context="Renderers" dev="GA" type="add" fixes-bug="FOP-2301">
+          Enable support for PDF sub-page transitions.
+      </action>
       <action context="Layout" dev="GA" type="fix" fixes-bug="FOP-2310">
           Fix misplaced table cell border in WM RTL context.
       </action>

Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/fonts/EmbedFontInfoTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/fonts/EmbedFontInfoTestCase.java?rev=1537948&r1=1537947&r2=1537948&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/fonts/EmbedFontInfoTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/fonts/EmbedFontInfoTestCase.java Fri Nov  1 14:34:18 2013
@@ -35,6 +35,8 @@ import static org.junit.Assert.assertTru
  */
 public class EmbedFontInfoTestCase {
 
+    public EmbedFontInfoTestCase() {}
+
     private EmbedFontInfo sut;
 
     private final URI metricsURI = URI.create("test/resources/fonts/ttf/glb12.ttf.xml");

Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/fonts/FontsTestSuite.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/fonts/FontsTestSuite.java?rev=1537948&r1=1537947&r2=1537948&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/fonts/FontsTestSuite.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/fonts/FontsTestSuite.java Fri Nov  1 14:34:18 2013
@@ -29,7 +29,7 @@ import org.junit.runners.Suite.SuiteClas
 @RunWith(Suite.class)
 @SuiteClasses({
         FontManagerConfiguratorTestCase.class,
-        EmbedFontInfo.class,
+        EmbedFontInfoTestCase.class,
         FontEventProcessingTestCase.class,
         FontManagerConfiguratorTestCase.class
 })

Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFDestsTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFDestsTestCase.java?rev=1537948&r1=1537947&r2=1537948&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFDestsTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFDestsTestCase.java Fri Nov  1 14:34:18 2013
@@ -32,7 +32,7 @@ import java.util.List;
 public class PDFDestsTestCase extends PDFObjectTestCase {
 
     private PDFDests dests = new PDFDests();
-    private String expectedString = "<< /Names [(number) 10 (name) /Test#20name] >>\n";
+    private String expectedString = "<< /Names [(number) 10 (name) /Test#20name] >>";
 
     @Before
     public void setUp() {

Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFDictionaryTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFDictionaryTestCase.java?rev=1537948&r1=1537947&r2=1537948&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFDictionaryTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFDictionaryTestCase.java Fri Nov  1 14:34:18 2013
@@ -47,7 +47,7 @@ public class PDFDictionaryTestCase exten
                                   + "  /array [1 (two) 20]\n"
                                   + "  /number 20\n"
                                   + "  /null null\n"
-                                  + ">>\n";
+                                  + ">>";
 
     @Before
     public void setUp() {

Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFPageLabelsTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFPageLabelsTestCase.java?rev=1537948&r1=1537947&r2=1537948&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFPageLabelsTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFPageLabelsTestCase.java Fri Nov  1 14:34:18 2013
@@ -37,11 +37,11 @@ public class PDFPageLabelsTestCase {
         int index = 0;
         StringBuilder expected = new StringBuilder();
         expected.append("[");
-        expected.append(index + " << /S /r >>\n");
+        expected.append(index + " << /S /r >>");
         pageLabels.addPageLabel(index++, "i");
         pageLabels.addPageLabel(index++, "ii");
         pageLabels.addPageLabel(index++, "iii");
-        expected.append(" " + index + " << /S /D >>\n");
+        expected.append(" " + index + " << /S /D >>");
         pageLabels.addPageLabel(index++, "1");
         pageLabels.addPageLabel(index++, "2");
         pageLabels.addPageLabel(index++, "3");
@@ -52,33 +52,33 @@ public class PDFPageLabelsTestCase {
         pageLabels.addPageLabel(index++, "8");
         pageLabels.addPageLabel(index++, "9");
         pageLabels.addPageLabel(index++, "10");
-        expected.append(" " + index + " << /S /A >>\n");
+        expected.append(" " + index + " << /S /A >>");
         pageLabels.addPageLabel(index++, "A");
         pageLabels.addPageLabel(index++, "B");
-        expected.append(" " + index + " << /S /R /St 100 >>\n");
+        expected.append(" " + index + " << /S /R /St 100 >>");
         pageLabels.addPageLabel(index++, "C");
-        expected.append(" " + index + " << /S /R /St 500 >>\n");
+        expected.append(" " + index + " << /S /R /St 500 >>");
         pageLabels.addPageLabel(index++, "D");
-        expected.append(" " + index + " << /S /A /St 5 >>\n");
+        expected.append(" " + index + " << /S /A /St 5 >>");
         pageLabels.addPageLabel(index++, "E");
         pageLabels.addPageLabel(index++, "F");
         pageLabels.addPageLabel(index++, "G");
-        expected.append(" " + index + " << /P (aa) >>\n");
+        expected.append(" " + index + " << /P (aa) >>");
         pageLabels.addPageLabel(index++, "aa");
-        expected.append(" " + index + " << /P (ab) >>\n");
+        expected.append(" " + index + " << /P (ab) >>");
         pageLabels.addPageLabel(index++, "ab");
-        expected.append(" " + index + " << /P (ac) >>\n");
+        expected.append(" " + index + " << /P (ac) >>");
         pageLabels.addPageLabel(index++, "ac");
-        expected.append(" " + index + " << /S /a >>\n");
+        expected.append(" " + index + " << /S /a >>");
         pageLabels.addPageLabel(index++, "a");
         pageLabels.addPageLabel(index++, "b");
-        expected.append(" " + index + " << /S /R /St 2 >>\n");
+        expected.append(" " + index + " << /S /R /St 2 >>");
         pageLabels.addPageLabel(index++, "II");
-        expected.append(" " + index + " << /S /R /St 12 >>\n");
+        expected.append(" " + index + " << /S /R /St 12 >>");
         pageLabels.addPageLabel(index++, "XII");
-        expected.append(" " + index + " <<\n  /P (00)\n  /S /D\n  /St 9\n>>\n");
+        expected.append(" " + index + " <<\n  /P (00)\n  /S /D\n  /St 9\n>>");
         pageLabels.addPageLabel(index++, "009");
-        expected.append(" " + index + " <<\n  /P (0)\n  /S /D\n  /St 10\n>>\n");
+        expected.append(" " + index + " <<\n  /P (0)\n  /S /D\n  /St 10\n>>");
         pageLabels.addPageLabel(index++, "010");
         pageLabels.addPageLabel(index++, "011");
         expected.append("]");

Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFStreamTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFStreamTestCase.java?rev=1537948&r1=1537947&r2=1537948&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFStreamTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFStreamTestCase.java Fri Nov  1 14:34:18 2013
@@ -118,7 +118,7 @@ public class PDFStreamTestCase {
 
     private byte[] createSampleStreamData() throws IOException {
         ByteArrayOutputStream stream = new ByteArrayOutputStream();
-        stream.write("stream\n".getBytes("US-ASCII"));
+        stream.write("\nstream\n".getBytes("US-ASCII"));
         stream.write(createSampleData());
         stream.write("\nendstream".getBytes("US-ASCII"));
         return stream.toByteArray();

Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/xref/CrossReferenceTableTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/xref/CrossReferenceTableTestCase.java?rev=1537948&r1=1537947&r2=1537948&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/xref/CrossReferenceTableTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/xref/CrossReferenceTableTestCase.java Fri Nov  1 14:34:18 2013
@@ -73,7 +73,7 @@ public class CrossReferenceTableTestCase
                 .append("  /Info 2 0 R\n")
                 .append("  /ID [<0123456789ABCDEF> <0123456789ABCDEF>]\n")
                 .append("  /Size ").append(Integer.toString(offsets.size() + 1)).append('\n')
-                .append(">>\n");
+                .append(">>");
         return getBytes(expected);
     }
 

Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/intermediate/AbstractIFPainterTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/intermediate/AbstractIFPainterTestCase.java?rev=1537948&r1=1537947&r2=1537948&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/intermediate/AbstractIFPainterTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/intermediate/AbstractIFPainterTestCase.java Fri Nov  1 14:34:18 2013
@@ -51,7 +51,7 @@ public class AbstractIFPainterTestCase {
             public void endViewport() throws IFException {
             }
 
-            public void startGroup(AffineTransform transform) throws IFException {
+            public void startGroup(AffineTransform transform, String layer) throws IFException {
             }
 
             public void endGroup() throws IFException {

Added: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/pdf-dictionary-extension_2.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/pdf-dictionary-extension_2.xml?rev=1537948&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/pdf-dictionary-extension_2.xml (added)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/pdf-dictionary-extension_2.xml Fri Nov  1 14:34:18 2013
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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$ -->
+<testcase>
+  <info>
+    <p>
+      This test checks the PDF dictionary extensions related to optional content groups (layers).
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf"
+      xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="simple">
+          <fo:region-body/>
+          <fo:region-before/>
+          <fo:region-after/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:declarations>
+        <!-- Optional Content Group Layers -->
+        <pdf:layer id="layer1">
+          <pdf:string key="Name">Bullet 1</pdf:string>
+        </pdf:layer>
+        <pdf:layer id="layer2">
+          <pdf:string key="Name">Bullet 2</pdf:string>
+        </pdf:layer>
+        <!-- Document Catalog's Optional Content (Layers) Directory and Default State -->
+        <pdf:catalog>
+          <pdf:dictionary key="OCProperties">
+            <!-- Directory of OCGs (layers) in Document -->
+            <pdf:array key="OCGs">
+              <pdf:reference refid="layer1"/>
+              <pdf:reference refid="layer2"/>
+            </pdf:array>
+            <!-- Default State for OCGs -->
+            <pdf:dictionary key="D">
+              <pdf:string key="Name">Default</pdf:string>
+              <pdf:name key="BaseState">OFF</pdf:name>
+            </pdf:dictionary>
+          </pdf:dictionary>
+        </pdf:catalog>
+      </fo:declarations>
+      <fo:page-sequence master-reference="simple">
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block fox:layer="layer1">
+            <fo:block>BULLET 1A</fo:block>
+            <fo:block>BULLET 1B</fo:block>
+          </fo:block>
+          <fo:block fox:layer="layer2">BULLET 2</fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks xmlns:pdf="apache:fop:extensions:pdf">
+    <eval expected="layer1" xpath="//flow/block[1]/@layer"/>
+    <eval expected="layer2" xpath="//flow/block[2]/@layer"/>
+  </checks>
+</testcase>

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/pdf-dictionary-extension_2.xml
------------------------------------------------------------------------------
    svn:eol-style = LF

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/pdf-dictionary-extension_2.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/pdf-dictionary-extension_3.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/pdf-dictionary-extension_3.xml?rev=1537948&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/pdf-dictionary-extension_3.xml (added)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/pdf-dictionary-extension_3.xml Fri Nov  1 14:34:18 2013
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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$ -->
+<testcase>
+  <info>
+    <p>
+      This test checks the PDF dictionary extensions related to optional content groups (layers),
+      including navigator and action dictionaries.
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf"
+             xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="simple">
+          <fo:region-body/>
+          <fo:region-before/>
+          <fo:region-after/>
+          <!-- Initial Layers Navigation Node for Page 1 -->
+          <pdf:page page-numbers="1">
+            <pdf:reference key="PresSteps" refid="navInitial"/>
+          </pdf:page>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:declarations>
+        <!-- Optional Content Group Layers -->
+        <pdf:layer id="layer1">
+          <pdf:string key="Name">Bullet 1</pdf:string>
+        </pdf:layer>
+        <pdf:layer id="layer2">
+          <pdf:string key="Name">Bullet 2</pdf:string>
+        </pdf:layer>
+        <!-- Navigator Actions -->
+        <pdf:action type="SetOCGState" id="setStateInitial">
+          <pdf:array key="State">
+            <pdf:name>OFF</pdf:name>
+            <pdf:reference refid="layer1"/>
+            <pdf:reference refid="layer2"/>
+          </pdf:array>
+        </pdf:action>
+        <pdf:action type="SetOCGState" id="setStateBullet1">
+          <pdf:array key="State">
+            <pdf:name>OFF</pdf:name>
+            <pdf:reference refid="layer2"/>
+            <pdf:name>ON</pdf:name>
+            <pdf:reference refid="layer1"/>
+          </pdf:array>
+        </pdf:action>
+        <pdf:action type="SetOCGState" id="setStateBullet2">
+          <pdf:array key="State">
+            <pdf:name>OFF</pdf:name>
+            <pdf:reference refid="layer1"/>
+            <pdf:name>ON</pdf:name>
+            <pdf:reference refid="layer2"/>
+          </pdf:array>
+        </pdf:action>
+        <!-- Navigators -->
+        <pdf:navigator id="navInitial">
+          <pdf:reference key="NA" refid="setStateBullet1"/>
+          <pdf:reference key="Next" refid="navBullet1"/>
+          <pdf:reference key="PA" refid="setStateInitial"/>
+          <pdf:reference key="Prev" refid="navInitial"/>
+        </pdf:navigator>
+        <pdf:navigator id="navBullet1">
+          <pdf:reference key="NA" refid="setStateBullet2"/>
+          <pdf:reference key="Next" refid="navBullet2"/>
+          <pdf:reference key="PA" refid="setStateInitial"/>
+          <pdf:reference key="Prev" refid="navInitial"/>
+        </pdf:navigator>
+        <pdf:navigator id="navBullet2">
+          <pdf:reference key="NA" refid="setStateBullet2"/>
+          <pdf:reference key="Next" refid="navBullet2"/>
+          <pdf:reference key="PA" refid="setStateBullet1"/>
+          <pdf:reference key="Prev" refid="navBullet1"/>
+        </pdf:navigator>
+        <!-- Document Catalog's Optional Content (Layers) Directory and Default State -->
+        <pdf:catalog>
+          <pdf:dictionary key="OCProperties">
+            <!-- Directory of OCGs (layers) in Document -->
+            <pdf:array key="OCGs">
+              <pdf:reference refid="layer1"/>
+              <pdf:reference refid="layer2"/>
+            </pdf:array>
+            <!-- Default State for OCGs -->
+            <pdf:dictionary key="D">
+              <pdf:string key="Name">Default</pdf:string>
+              <pdf:name key="BaseState">OFF</pdf:name>
+            </pdf:dictionary>
+          </pdf:dictionary>
+        </pdf:catalog>
+      </fo:declarations>
+      <fo:page-sequence master-reference="simple">
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block fox:layer="layer1">
+            <fo:block>BULLET 1A</fo:block>
+            <fo:block>BULLET 1B</fo:block>
+          </fo:block>
+          <fo:block fox:layer="layer2">BULLET 2</fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks xmlns:pdf="apache:fop:extensions:pdf">
+    <eval expected="layer1" xpath="//flow/block[1]/@layer"/>
+    <eval expected="layer2" xpath="//flow/block[2]/@layer"/>
+  </checks>
+</testcase>

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/pdf-dictionary-extension_3.xml
------------------------------------------------------------------------------
    svn:eol-style = LF

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/pdf-dictionary-extension_3.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



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