Smalot\PdfParser\Header::get PHP Method

get() public method

public get ( string $name ) : Smalot\PdfParser\Element | Smalot\PdfParser\Object
$name string
return Smalot\PdfParser\Element | Smalot\PdfParser\Object
    public function get($name)
    {
        if (array_key_exists($name, $this->elements)) {
            return $this->resolveXRef($name);
        }
        return new ElementMissing(null, null);
    }

Usage Example

Esempio n. 1
0
 /**
  * Build details array.
  */
 protected function buildDetails()
 {
     // Build details array.
     $details = array();
     // Extract document info
     if ($this->trailer->has('Info')) {
         /** @var Object $info */
         $info = $this->trailer->get('Info');
         $details = $info->getHeader()->getDetails();
     }
     // Retrieve the page count
     try {
         $pages = $this->getPages();
         $details['Pages'] = count($pages);
     } catch (\Exception $e) {
         $details['Pages'] = 0;
     }
     $this->details = $details;
 }
All Usage Examples Of Smalot\PdfParser\Header::get