/** * Set text to be displayed for the annotation or, if this type of annotation * does not display text, an alternate description of the annotation’s contents * in human-readable form. * * @param string $text * @return \ZendPdf\Annotation\AbstractAnnotation */ public function setText($text) { if ($this->_annotationDictionary->Contents === null) { $this->_annotationDictionary->touch(); $this->_annotationDictionary->Contents = new InternalType\StringObject($text); } else { $this->_annotationDictionary->Contents->touch(); $this->_annotationDictionary->Contents->value = new InternalType\StringObject($text); } return $this; }
/** * Mark object as modified, to include it into new PDF file segment. * * We don't automate this action to keep control on PDF update process. * All new objects are treated as "modified" automatically. */ public function touch() { if ($this->_parentObject !== null) { $this->_parentObject->touch(); } }