/**
  * @param string $path
  * @param array $properties
  *
  * @throws \PHPExcel_Exception
  */
 public function start($path, array $properties = null)
 {
     if ($this->sheetWrapper->getObject() === null) {
         throw new \LogicException();
     }
     // create local copy of the asset
     $tempPath = $this->createTempCopy($path);
     // add to header/footer
     if ($this->headerFooterWrapper->getObject()) {
         $headerFooterAttributes = $this->headerFooterWrapper->getAttributes();
         $location = '';
         switch (strtolower($this->headerFooterWrapper->getAlignmentAttributes()['type'])) {
             case 'left':
                 $location .= 'L';
                 $headerFooterAttributes['value']['left'] .= '&G';
                 break;
             case 'center':
                 $location .= 'C';
                 $headerFooterAttributes['value']['center'] .= '&G';
                 break;
             case 'right':
                 $location .= 'R';
                 $headerFooterAttributes['value']['right'] .= '&G';
                 break;
             default:
                 throw new \InvalidArgumentException();
         }
         switch (strtolower($headerFooterAttributes['type'])) {
             case 'header':
             case 'oddheader':
             case 'evenheader':
             case 'firstheader':
                 $location .= 'H';
                 break;
             case 'footer':
             case 'oddfooter':
             case 'evenfooter':
             case 'firstfooter':
                 $location .= 'F';
                 break;
             default:
                 throw new \InvalidArgumentException();
         }
         $this->object = new \PHPExcel_Worksheet_HeaderFooterDrawing();
         $this->object->setPath($tempPath);
         $this->headerFooterWrapper->getObject()->addImage($this->object, $location);
         $this->headerFooterWrapper->setAttributes($headerFooterAttributes);
     } else {
         $this->object = new \PHPExcel_Worksheet_Drawing();
         $this->object->setWorksheet($this->sheetWrapper->getObject());
         $this->object->setPath($tempPath);
     }
     if ($properties !== null) {
         $this->setProperties($properties, $this->mappings);
     }
 }
 /**
  * @param null|string $value
  */
 public function endAlignment($value = null)
 {
     $this->headerFooterWrapper->endAlignment($value);
 }