import java.util.ArrayList;
import org.xml.sax.Attributes;
-import org.apache.fop.area.extensions.BookmarkData;
/**
* The outline object for the pdf bookmark extension.
}
}
- /**
- * Get the bookmark data for this outline.
- * This creates a bookmark data with the destination
- * and adds all the data from child outlines.
- *
- * @return the new bookmark data
- */
- public BookmarkData getData() {
- BookmarkData data = new BookmarkData(internalDestination);
- data.setLabel(getLabel());
- for (int count = 0; count < outlines.size(); count++) {
- Outline out = (Outline)outlines.get(count);
- data.addSubData(out.getData());
- }
- return data;
- }
-
/**
* Get the label string.
* This gets the label string from the child label element.
fotv.serveVisitor(this);
}
-}
+ public String getInternalDestination() {
+ return internalDestination;
+ }
+
+ public String getExternalDestination() {
+ return externalDestination;
+ }
+ public ArrayList getOutlines() {
+ return outlines;
+ }
+
+}
BookmarkData data = new BookmarkData();
for (int count = 0; count < document.getBookmarks().getOutlines().size(); count++) {
Outline out = (Outline)(document.getBookmarks().getOutlines()).get(count);
- data.addSubData(out.getData());
+ data.addSubData(createBookmarkData(out));
}
// add data to area tree for resolving and handling
if (document.getBookmarks().getFOInputHandler() instanceof FOTreeHandler) {
}
}
+ /**
+ * Create and return the bookmark data for this outline.
+ * This creates a bookmark data with the destination
+ * and adds all the data from child outlines.
+ *
+ * @return the new bookmark data
+ */
+ public 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));
+ }
+ return data;
+ }
+
}