Ejemplo n.º 1
0
 /**
  * Annotation object constructor
  *
  * @throws \ZendPdf\Exception\ExceptionInterface
  */
 public function __construct(InternalType\AbstractTypeObject $annotationDictionary)
 {
     if ($annotationDictionary->getType() != InternalType\AbstractTypeObject::TYPE_DICTIONARY) {
         throw new Exception\CorruptedPdfException('Annotation dictionary resource has to be a dictionary.');
     }
     if ($annotationDictionary->Subtype === null || $annotationDictionary->Subtype->getType() != InternalType\AbstractTypeObject::TYPE_NAME || $annotationDictionary->Subtype->value != 'Text') {
         throw new Exception\CorruptedPdfException('Subtype => Text entry is requires');
     }
     parent::__construct($annotationDictionary);
 }
Ejemplo n.º 2
0
 /**
  * Annotation object constructor
  *
  * @throws \ZendPdf\Exception\ExceptionInterface
  */
 public function __construct(InternalType\AbstractTypeObject $annotationDictionary)
 {
     if ($annotationDictionary->getType() != InternalType\AbstractTypeObject::TYPE_DICTIONARY) {
         throw new Exception\CorruptedPdfException('Annotation dictionary resource has to be a dictionary.');
     }
     if ($annotationDictionary->Subtype === null || $annotationDictionary->Subtype->getType() != InternalType\AbstractTypeObject::TYPE_NAME || !in_array($annotationDictionary->Subtype->value, array(self::SUBTYPE_HIGHLIGHT, self::SUBTYPE_UNDERLINE, self::SUBTYPE_SQUIGGLY, self::SUBTYPE_STRIKEOUT))) {
         throw new Exception\CorruptedPdfException('Subtype => Markup entry is omitted or has wrong value.');
     }
     parent::__construct($annotationDictionary);
 }