Example #1
0
File: Note.php Project: alipek/rtf
 /**
  * Takes a line of HTML to prepend to the top of the RTF originally passed to setRTF(). Converts HTML in that
  * line to RTF tokens and also updates the RTF document's color table & font table.
  */
 function prependNote($noteDataToPrepend)
 {
     if (!isset($noteDataToPrepend['fontsize'])) {
         $noteDataToPrepend['fontsize'] = self::DEFAULT_FONTSIZE;
     }
     if (!isset($noteDataToPrepend['font'])) {
         $noteDataToPrepend['font'] = self::DEFAULT_FONT;
     }
     $converter = new JoshRibakoff_Note_HTMLToRTF();
     $converter->setColorTable($this->rtf_colortable);
     $noteDataToPrepend['text'] = $converter->convert($noteDataToPrepend['text']);
     $this->rtf_colortable = $converter->newColorTable();
     array_unshift($this->rtf_text_pieces, $noteDataToPrepend);
     $this->updateRTF();
 }