24 #require_once 'Zend/Pdf/Element.php'; 54 #require_once 'Zend/Pdf/Exception.php'; 58 $intermediateNodes = array();
60 if ($rootDictionary->Kids !==
null) {
61 $intermediateNodes[] = $rootDictionary;
63 $leafNodes[] = $rootDictionary;
66 while (
count($intermediateNodes) != 0) {
67 $newIntermediateNodes = array();
68 foreach ($intermediateNodes as $node) {
69 foreach ($node->Kids->items as $childNode) {
70 if ($childNode->Kids !==
null) {
71 $newIntermediateNodes[] = $childNode;
73 $leafNodes[] = $childNode;
77 $intermediateNodes = $newIntermediateNodes;
80 foreach ($leafNodes as $leafNode) {
81 $destinationsCount =
count($leafNode->Names->items)/2;
83 $this->_items[$leafNode->Names->items[
$count*2]->value] = $leafNode->Names->items[
$count*2 + 1];
96 return next($this->_items);
102 return key($this->_items);
107 return current($this->_items)!==
false;
113 reset($this->_items);
119 return array_key_exists($offset, $this->_items);
125 return $this->_items[$offset];
131 if ($offset ===
null) {
134 $this->_items[$offset] =
$value;
141 unset($this->_items[$offset]);
147 $this->_items = array();
152 return count($this->_items);
__construct(Zend_Pdf_Element $rootDictionary)
offsetSet($offset, $value)