| @@ 133-155 (lines=23) @@ | ||
| 130 | * |
|
| 131 | * @param array $obj Array of pdf-data |
|
| 132 | */ |
|
| 133 | function _getPageResources ($obj) { // $obj = /Page
|
|
| 134 | $obj = $this->pdf_resolve_object($this->c, $obj); |
|
| 135 | ||
| 136 | // If the current object has a resources |
|
| 137 | // dictionary associated with it, we use |
|
| 138 | // it. Otherwise, we move back to its |
|
| 139 | // parent object. |
|
| 140 | if (isset ($obj[1][1]['/Resources'])) {
|
|
| 141 | $res = $this->pdf_resolve_object($this->c, $obj[1][1]['/Resources']); |
|
| 142 | if ($res[0] == PDF_TYPE_OBJECT) |
|
| 143 | return $res[1]; |
|
| 144 | return $res; |
|
| 145 | } else {
|
|
| 146 | if (!isset ($obj[1][1]['/Parent'])) {
|
|
| 147 | return false; |
|
| 148 | } else {
|
|
| 149 | $res = $this->_getPageResources($obj[1][1]['/Parent']); |
|
| 150 | if ($res[0] == PDF_TYPE_OBJECT) |
|
| 151 | return $res[1]; |
|
| 152 | return $res; |
|
| 153 | } |
|
| 154 | } |
|
| 155 | } |
|
| 156 | ||
| 157 | ||
| 158 | /** |
|
| @@ 324-341 (lines=18) @@ | ||
| 321 | return $this->_getPageRotation($this->pages[$pageno-1]); |
|
| 322 | } |
|
| 323 | ||
| 324 | function _getPageRotation ($obj) { // $obj = /Page
|
|
| 325 | $obj = $this->pdf_resolve_object($this->c, $obj); |
|
| 326 | if (isset ($obj[1][1]['/Rotate'])) {
|
|
| 327 | $res = $this->pdf_resolve_object($this->c, $obj[1][1]['/Rotate']); |
|
| 328 | if ($res[0] == PDF_TYPE_OBJECT) |
|
| 329 | return $res[1]; |
|
| 330 | return $res; |
|
| 331 | } else {
|
|
| 332 | if (!isset ($obj[1][1]['/Parent'])) {
|
|
| 333 | return false; |
|
| 334 | } else {
|
|
| 335 | $res = $this->_getPageRotation($obj[1][1]['/Parent']); |
|
| 336 | if ($res[0] == PDF_TYPE_OBJECT) |
|
| 337 | return $res[1]; |
|
| 338 | return $res; |
|
| 339 | } |
|
| 340 | } |
|
| 341 | } |
|
| 342 | ||
| 343 | /** |
|
| 344 | * Read all /Page(es) |
|