]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
PR:
authorGlen Mazza <gmazza@apache.org>
Tue, 4 Jan 2005 00:21:47 +0000 (00:21 +0000)
committerGlen Mazza <gmazza@apache.org>
Tue, 4 Jan 2005 00:21:47 +0000 (00:21 +0000)
Obtained from:
Submitted by:
Reviewed by:
Converted fox:outline to fo:bookmark.  fox:label/fo:bookmark-title still to
be done.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198221 13f79535-47bb-0310-9956-ffa450edef68

examples/fo/advanced/cid-fonts.fo
examples/fo/basic/pdfoutline.fo
src/java/org/apache/fop/area/BookmarkData.java
src/java/org/apache/fop/fo/Constants.java
src/java/org/apache/fop/fo/FOElementMapping.java
src/java/org/apache/fop/fo/PropertySets.java
src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java
src/java/org/apache/fop/fo/extensions/Outline.java [deleted file]
src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java [new file with mode: 0644]
src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTree.java
src/java/org/apache/fop/render/pdf/PDFRenderer.java

index dc55f7ac942c7c3de87d04db8ab9fb13273b3238..556aa8a2d1d4e2521c5698038127c39a7492973f 100644 (file)
  </fo:layout-master-set>
 
 <fo:bookmark-tree>
-  <fox:outline internal-destination="sec0">
+  <fo:bookmark internal-destination="sec0">
     <fox:label>Adding Fonts to FOP</fox:label>
-  </fox:outline>
+  </fo:bookmark>
 
-  <fox:outline internal-destination="sec1">
+  <fo:bookmark internal-destination="sec1">
     <fox:label>Adding additional Type 1 fonts</fox:label>
 
-    <fox:outline internal-destination="sec1-1">
+    <fo:bookmark internal-destination="sec1-1">
       <fox:label>Generating a font metrics file</fox:label>
-    </fox:outline>
-    <fox:outline internal-destination="sec1-2">
+    </fo:bookmark>
+    <fo:bookmark internal-destination="sec1-2">
       <fox:label>Register the fonts within FOP</fox:label>
-    </fox:outline>
-  </fox:outline>
+    </fo:bookmark>
+  </fo:bookmark>
 
-  <fox:outline internal-destination="sec2">
+  <fo:bookmark internal-destination="sec2">
     <fox:label>Adding additional TrueType fonts</fox:label>
 
-    <fox:outline internal-destination="sec2-1">
+    <fo:bookmark internal-destination="sec2-1">
       <fox:label>Generating a font metrics file</fox:label>
-    </fox:outline>
-    <fox:outline internal-destination="sec2-2">
+    </fo:bookmark>
+    <fo:bookmark internal-destination="sec2-2">
       <fox:label>TrueType collections</fox:label>
-    </fox:outline>
-    <fox:outline internal-destination="sec2-3">
+    </fo:bookmark>
+    <fo:bookmark internal-destination="sec2-3">
       <fox:label>Register the fonts within FOP</fox:label>
-    </fox:outline>
+    </fo:bookmark>
 
-  </fox:outline>
+  </fo:bookmark>
 
- <fox:outline internal-destination="sec3">
+ <fo:bookmark internal-destination="sec3">
     <fox:label>Embedding fonts in the PDF</fox:label>
-  </fox:outline>
+  </fo:bookmark>
 
- <fox:outline internal-destination="sec4">
+ <fo:bookmark internal-destination="sec4">
     <fox:label>Example embedding MSGothic</fox:label>
 
-   <fox:outline internal-destination="sec4-1">
+   <fo:bookmark internal-destination="sec4-1">
       <fox:label>Setup CLASSPATH</fox:label>
-   </fox:outline>
+   </fo:bookmark>
 
-   <fox:outline internal-destination="sec4-2">
+   <fo:bookmark internal-destination="sec4-2">
       <fox:label>Create the metrics file</fox:label>
-   </fox:outline>
+   </fo:bookmark>
 
-   <fox:outline internal-destination="sec4-3">
+   <fo:bookmark internal-destination="sec4-3">
       <fox:label>Edit msgothic.xml</fox:label>
-   </fox:outline>
+   </fo:bookmark>
 
-   <fox:outline internal-destination="sec4-4">
+   <fo:bookmark internal-destination="sec4-4">
       <fox:label>Register the font with FOP</fox:label>
-   </fox:outline>
- </fox:outline>
+   </fo:bookmark>
+ </fo:bookmark>
 
- <fox:outline internal-destination="sec5">
+ <fo:bookmark internal-destination="sec5">
     <fox:label>Japanese Examples</fox:label>
- </fox:outline>
+ </fo:bookmark>
 </fo:bookmark-tree>
 
  <fo:page-sequence master-reference="A4">
index 276d61e99b04581fcfefa3f9bf82b9a83bc081de..ce1aa35973bd6666c8fee2ef36eeb4c7d348f419 100644 (file)
@@ -60,65 +60,65 @@ This files shows next to the trivial usage of fo:block and fo:inline examples of
 
 <!-- bookmark section -->
   <fo:bookmark-tree>
-      <fox:outline internal-destination="sec1">
+      <fo:bookmark internal-destination="sec1">
         <fox:label>What is FOP?</fox:label>
-      </fox:outline>
+      </fo:bookmark>
     
-      <fox:outline internal-destination="sec2">
+      <fo:bookmark internal-destination="sec2">
         <fox:label>Downloading FOP</fox:label>
-      </fox:outline>
+      </fo:bookmark>
     
-      <fox:outline internal-destination="sec3">
+      <fo:bookmark internal-destination="sec3">
         <fox:label>Running FOP</fox:label>
     
-        <fox:outline internal-destination="sec3-1">
+        <fo:bookmark internal-destination="sec3-1">
           <fox:label>Prerequisites</fox:label>
     
-          <fox:outline internal-destination="sec3-1-1">
+          <fo:bookmark internal-destination="sec3-1-1">
             <fox:label>Java 1.1</fox:label>
-          </fox:outline>
+          </fo:bookmark>
     
-          <fox:outline internal-destination="sec3-1-2">
+          <fo:bookmark internal-destination="sec3-1-2">
             <fox:label>XML Parser</fox:label>
-          </fox:outline>
+          </fo:bookmark>
     
-          <fox:outline internal-destination="sec3-1-3">
+          <fo:bookmark internal-destination="sec3-1-3">
             <fox:label>XSLT Processor</fox:label>
-          </fox:outline>
+          </fo:bookmark>
     
-        </fox:outline>
+        </fo:bookmark>
     
-        <fox:outline internal-destination="sec3-2">
+        <fo:bookmark internal-destination="sec3-2">
           <fox:label>Starting FOP</fox:label>
-        </fox:outline>
+        </fo:bookmark>
     
-      </fox:outline>
+      </fo:bookmark>
     
-      <fox:outline internal-destination="sec4">
+      <fo:bookmark internal-destination="sec4">
         <fox:label>Embedding FOP</fox:label>
-      </fox:outline>
+      </fo:bookmark>
     
-      <fox:outline internal-destination="sec5">
+      <fo:bookmark internal-destination="sec5">
         <fox:label>What's Implemented?</fox:label>
-      </fox:outline>
-      <fox:outline internal-destination="sec6">
+      </fo:bookmark>
+      <fo:bookmark internal-destination="sec6">
         <fox:label>Limitations</fox:label>
-      </fox:outline>
-      <fox:outline internal-destination="sec7">
+      </fo:bookmark>
+      <fo:bookmark internal-destination="sec7">
         <fox:label>Bugs</fox:label>
-      </fox:outline>
-      <fox:outline internal-destination="sec8">
+      </fo:bookmark>
+      <fo:bookmark internal-destination="sec8">
         <fox:label>Compiling FOP</fox:label>
-      </fox:outline>
-      <fox:outline internal-destination="sec9">
+      </fo:bookmark>
+      <fo:bookmark internal-destination="sec9">
         <fox:label>Getting Involved</fox:label>
-      </fox:outline>
-      <fox:outline internal-destination="sec10">
+      </fo:bookmark>
+      <fo:bookmark internal-destination="sec10">
         <fox:label>FOP Relevant Specifications</fox:label>
-      </fox:outline>
-      <fox:outline internal-destination="sec11">
+      </fo:bookmark>
+      <fo:bookmark internal-destination="sec11">
         <fox:label>License</fox:label>
-      </fox:outline>
+      </fo:bookmark>
   </fo:bookmark-tree>
 
   <!-- actual layout -->
index 23fd9258315a6e8e7a56563ab6d035aa731a8261..3659d1fb116dbf3edc66349266c3e1b3e914059d 100644 (file)
@@ -23,7 +23,7 @@ import java.util.List;
 import java.util.HashMap;
 
 import org.apache.fop.fo.pagination.bookmarks.BookmarkTree;
-import org.apache.fop.fo.extensions.Outline;
+import org.apache.fop.fo.pagination.bookmarks.Bookmark;
 
 /**
  * An instance of this class is either a PDF bookmark-tree and
@@ -33,8 +33,8 @@ import org.apache.fop.fo.extensions.Outline;
 public class BookmarkData extends OffDocumentItem implements Resolvable {
     private ArrayList subData = new ArrayList();
 
-    // bookmark label
-    private String label = null;
+    // bookmark-title for this bookmark
+    private String bookmarkTitle = null;
 
     // ID Reference for this bookmark
     private String idRef;
@@ -57,8 +57,8 @@ public class BookmarkData extends OffDocumentItem implements Resolvable {
         whenToProcess = END_OF_DOC;
         
         for (int count = 0; count < bookmarkTree.getBookmarks().size(); count++) {
-            Outline out = (Outline)(bookmarkTree.getBookmarks()).get(count);
-            addSubData(createBookmarkData(out));
+            Bookmark bkmk = (Bookmark)(bookmarkTree.getBookmarks()).get(count);
+            addSubData(createBookmarkData(bkmk));
         }
     }
 
@@ -100,21 +100,21 @@ public class BookmarkData extends OffDocumentItem implements Resolvable {
     }
 
     /**
-     * Set the label for this bookmark.
+     * Set the title for this bookmark.
      *
-     * @param l the string label
+     * @param title the bookmark title
      */
-    public void setLabel(String l) {
-        label = l;
+    public void setBookmarkTitle(String title) {
+        bookmarkTitle = title;
     }
 
     /**
-     * Get the label for this bookmark object.
+     * Get the title for this bookmark object.
      *
-     * @return the label string
+     * @return the bookmark title
      */
-    public String getLabel() {
-        return label;
+    public String getBookmarkTitle() {
+        return bookmarkTitle;
     }
 
     /**
@@ -195,20 +195,20 @@ public class BookmarkData extends OffDocumentItem implements Resolvable {
     }
 
     /**
-     * Create and return the bookmark data for this outline.
+     * Create and return the bookmark data for this bookmark
      * This creates a bookmark data with the destination
-     * and adds all the data from child outlines.
+     * and adds all the data from child bookmarks
      *
-     * @param outline the Outline object for which a bookmark entry should be
+     * @param bookmark the Bookmark object for which a bookmark entry should be
      * created
      * @return the new bookmark data
      */
-    private BookmarkData createBookmarkData(Outline outline) {
-        BookmarkData data = new BookmarkData(outline.getInternalDestination());
-        data.setLabel(outline.getLabel());
-        for (int count = 0; count < outline.getOutlines().size(); count++) {
-            Outline out = (Outline)(outline.getOutlines()).get(count);
-            data.addSubData(createBookmarkData(out));
+    private BookmarkData createBookmarkData(Bookmark bookmark) {
+        BookmarkData data = new BookmarkData(bookmark.getInternalDestination());
+        data.setBookmarkTitle(bookmark.getBookmarkTitle());
+        for (int count = 0; count < bookmark.getChildBookmarks().size(); count++) {
+            Bookmark bkmk = (Bookmark)(bookmark.getChildBookmarks()).get(count);
+            data.addSubData(createBookmarkData(bkmk));
         }
         return data;
     }
index 7f1d4052119e259c715b32af12597b4921c83951..192ad5560e70b4b926b4cd06e352bcbb0712b754 100644 (file)
@@ -114,7 +114,8 @@ public interface Constants {
     int FO_TITLE = 55;
     int FO_WRAPPER = 56;
     int FO_BOOKMARK_TREE = 57;
-    int FRM_OBJ_COUNT = 57;
+    int FO_BOOKMARK = 58;
+    int FRM_OBJ_COUNT = 58;
     
     // Masks
     int COMPOUND_SHIFT = 9;
index 760adeb3378cb6193398649f0c336068b2eb406a..1fa266778a79fd657d60a88798b0e5eb2955cd23 100644 (file)
@@ -46,6 +46,7 @@ public class FOElementMapping extends ElementMapping {
             foObjs.put("declarations", new DeclarationsMaker());
             foObjs.put("color-profile", new ColorProfileMaker());
             foObjs.put("bookmark-tree", new BookmarkTreeMaker());
+            foObjs.put("bookmark", new BookmarkMaker());
             foObjs.put("page-sequence", new PageSequenceMaker());
             foObjs.put("layout-master-set", new LayoutMasterSetMaker());
             foObjs.put("page-sequence-master",
@@ -152,6 +153,12 @@ public class FOElementMapping extends ElementMapping {
         }
     }
 
+    static class BookmarkMaker extends ElementMapping.Maker {
+        public FONode make(FONode parent) {
+            return new org.apache.fop.fo.pagination.bookmarks.Bookmark(parent);
+        }
+    }
+
     static class PageSequenceMaker extends ElementMapping.Maker {
         public FONode make(FONode parent) {
             return new org.apache.fop.fo.pagination.PageSequence(parent);
index 64e50fd13293351cbf7f135d43a9f5a6e6dc5931..418d23bacb034e7e1400aff2e5acb1f2f8506f32 100644 (file)
@@ -202,7 +202,15 @@ public class PropertySets {
         elem.addProperty(Constants.PR_RENDERING_INTENT);
 
         elem = elements[Constants.FO_BOOKMARK_TREE];
-//      elem.addContent(Constants.FO_BOOKMARK);
+        elem.addContent(Constants.FO_BOOKMARK);
+
+        elem = elements[Constants.FO_BOOKMARK];
+//      elem.addContent(Constants.FO_BOOKMARK_TITLE);
+        elem.addContent(Constants.FO_BOOKMARK);
+        elem.addProperties(CommonAccessibilityProperties);
+        elem.addProperty(Constants.PR_EXTERNAL_DESTINATION);
+        elem.addProperty(Constants.PR_INTERNAL_DESTINATION);
+        elem.addProperty(Constants.PR_STARTING_STATE);
 
         elem = elements[Constants.FO_PAGE_SEQUENCE];
         elem.addProperty(Constants.PR_COUNTRY);
index 16e30ef8aebcd1adb21051dfec0f9d5c4e21754d..3e0067d126ad0a48f81389a73fd17d09f4ac3678 100644 (file)
@@ -44,17 +44,10 @@ public class ExtensionElementMapping extends ElementMapping {
     protected void initialize() {
         if (foObjs == null) {
             foObjs = new HashMap();
-            foObjs.put("outline", new O());
             foObjs.put("label", new L());
         }
     }
 
-    static class O extends ElementMapping.Maker {
-        public FONode make(FONode parent) {
-            return new Outline(parent);
-        }
-    }
-
     static class L extends ElementMapping.Maker {
         public FONode make(FONode parent) {
             return new Label(parent);
diff --git a/src/java/org/apache/fop/fo/extensions/Outline.java b/src/java/org/apache/fop/fo/extensions/Outline.java
deleted file mode 100644 (file)
index a7df632..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- * 
- * Licensed 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.fo.extensions;
-
-import java.util.ArrayList;
-
-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;
-
-
-/**
- * The outline object for the pdf bookmark extension.
- * The outline element contains a label and optionally more outlines.
- */
-public class Outline extends ExtensionObj {
-    private Label label;
-    private ArrayList outlines = new ArrayList();
-
-    private String internalDestination;
-    private String externalDestination;
-
-    /**
-     * Create a new outline object.
-     *
-     * @param parent the parent fo node
-     */
-    public Outline(FONode parent) {
-        super(parent);
-    }
-
-    /**
-     * The attributes on the outline object are the internal and external
-     * destination. One of these is required.
-     *
-     * @see org.apache.fop.fo.FObj#processNode
-     */
-    public void processNode(String elementName, Locator locator, 
-            Attributes attlist, PropertyList propertyList) throws FOPException 
-    {
-        internalDestination =
-            attlist.getValue("internal-destination");
-        externalDestination =
-            attlist.getValue("external-destination");
-        if (externalDestination != null && !externalDestination.equals("")) {
-            getLogger().warn("fox:outline external-destination not supported currently.");
-        }
-
-        if (internalDestination == null || internalDestination.equals("")) {
-            getLogger().warn("fox:outline requires an internal-destination.");
-        }
-
-    }
-
-    /**
-     * @see org.apache.fop.fo.FONode#addChildNode(FONode)
-     */
-    protected void addChildNode(FONode obj) {
-        if (obj instanceof Label) {
-            label = (Label)obj;
-        } else if (obj instanceof Outline) {
-            outlines.add(obj);
-        }
-    }
-
-    /**
-     * Get the label string.
-     * This gets the label string from the child label element.
-     *
-     * @return the label string or empty if not found
-     */
-    public String getLabel() {
-        return label == null ? "" : label.toString();
-    }
-
-    public String getInternalDestination() {
-        return internalDestination;
-    }
-
-    public String getExternalDestination() {
-        return externalDestination;
-    }
-
-    public ArrayList getOutlines() {
-        return outlines;
-    }
-
-    public String getName() {
-        return "(http://xml.apache.org/fop/extensions) outline";
-    }
-}
diff --git a/src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java b/src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java
new file mode 100644 (file)
index 0000000..4ba55d3
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.fo.pagination.bookmarks;
+
+import java.util.ArrayList;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.extensions.Label;
+
+
+/**
+ * The fo:bookmark formatting object, first introduced in the 
+ * XSL 1.1 WD.  Prototype version only, subject to change as
+ * XSL 1.1 WD evolves.
+ */
+public class Bookmark extends FObj {
+    private Label bookmarkTitle;
+    private ArrayList childBookmarks = new ArrayList();
+
+    private String internalDestination;
+    private String externalDestination;
+
+    /**
+     * Create a new bookmark object.
+     *
+     * @param parent the parent fo node
+     */
+    public Bookmark(FONode parent) {
+        super(parent);
+    }
+
+    /**
+     * The attributes on the bookmark object are the internal and external
+     * destination. One of these is required.
+     *
+     * @see org.apache.fop.fo.FObj#processNode
+     * @todo to include all properties of fo:bookmark
+     */
+    public void processNode(String elementName, Locator locator, 
+            Attributes attlist, PropertyList propertyList) throws FOPException 
+    {
+        internalDestination =
+            attlist.getValue("internal-destination");
+        externalDestination =
+            attlist.getValue("external-destination");
+        if (externalDestination != null && !externalDestination.equals("")) {
+            getLogger().warn("fo:bookmark external-destination not supported currently.");
+        }
+
+        if (internalDestination == null || internalDestination.equals("")) {
+            getLogger().warn("fo:bookmark requires an internal-destination.");
+        }
+
+    }
+
+    /**
+     * @see org.apache.fop.fo.FONode#addChildNode(FONode)
+     */
+    protected void addChildNode(FONode obj) {
+        if (obj instanceof Label) {
+            bookmarkTitle = (Label)obj;
+        } else if (obj instanceof Bookmark) {
+            childBookmarks.add(obj);
+        }
+    }
+
+    /**
+     * Get the bookmark title for this bookmark
+     *
+     * @return the bookmark title string or an empty string if not found
+     */
+    public String getBookmarkTitle() {
+        return bookmarkTitle == null ? "" : bookmarkTitle.toString();
+    }
+
+    public String getInternalDestination() {
+        return internalDestination;
+    }
+
+    public String getExternalDestination() {
+        return externalDestination;
+    }
+
+    public ArrayList getChildBookmarks() {
+        return childBookmarks;
+    }
+
+    /**
+     * @see org.apache.fop.fo.FObj#getName()
+     */
+    public String getName() {
+        return "fo:bookmark";
+    }
+
+    /**
+     * @see org.apache.fop.fo.FObj#getNameId()
+     */
+    public int getNameId() {
+        return FO_BOOKMARK;
+    }
+}
index 43daeda05e67c5af8985809eaf1935032c607a8e..b5af4efcf0874bd25bce6f1b3eb3f0d5c0b9dc4e 100644 (file)
@@ -24,8 +24,6 @@ import java.util.ArrayList;
 import org.xml.sax.Locator;
 
 import org.apache.fop.apps.FOPException;
-import org.apache.fop.fo.extensions.ExtensionElementMapping;
-import org.apache.fop.fo.extensions.Outline;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
@@ -52,7 +50,7 @@ public class BookmarkTree extends FObj {
      * @see org.apache.fop.fo.FONode#addChildNode(FONode)
      */
     protected void addChildNode(FONode obj) {
-        if (obj instanceof Outline) {
+        if (obj instanceof Bookmark) {
             bookmarks.add(obj);
         }
     }
@@ -62,7 +60,7 @@ public class BookmarkTree extends FObj {
      */
     protected void endOfNode() throws FOPException {
         if (bookmarks == null) {
-           missingChildElementError("(fox:outline+)");
+           missingChildElementError("(fo:bookmark+)");
         }
         ((Root) parent).setBookmarkTree(this);
     }
@@ -73,8 +71,8 @@ public class BookmarkTree extends FObj {
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
         throws ValidationException {
-        if (!(nsURI == ExtensionElementMapping.URI &&
-            localName.equals("outline"))) {
+        if (!(nsURI == FO_URI &&
+            localName.equals("bookmark"))) {
                 invalidChildError(loc, nsURI, localName);
         }
     }
index ac8450881a244da1b17f4ed3fa19715145a0ed3a..834333d776b9fb0a8ed077cf36b0dc29ab5cbb82 100644 (file)
@@ -311,10 +311,10 @@ public class PDFRenderer extends PrintRenderer {
             if (parentBookmarkItem == null) {
                 PDFOutline outlineRoot = pdfDoc.getOutlineRoot();
                 pdfOutline = pdfDoc.getFactory().makeOutline(outlineRoot,
-                                        bookmarkItem.getLabel(), intDest, yoffset);
+                                        bookmarkItem.getBookmarkTitle(), intDest, yoffset);
             } else {
                 pdfOutline = pdfDoc.getFactory().makeOutline(parentBookmarkItem,
-                                        bookmarkItem.getLabel(), intDest, yoffset);
+                                        bookmarkItem.getBookmarkTitle(), intDest, yoffset);
             }
         }