コード例 #1
0
ファイル: Base.php プロジェクト: heruprambadi/sim_penyuratan
 protected function _writeTextRun(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_TextRun $textrun)
 {
     $elements = $textrun->getElements();
     $styleParagraph = $textrun->getParagraphStyle();
     $SpIsObject = $styleParagraph instanceof PHPWord_Style_Paragraph ? true : false;
     $objWriter->startElement('w:p');
     if ($SpIsObject) {
         $this->_writeParagraphStyle($objWriter, $styleParagraph);
     } elseif (!$SpIsObject && !is_null($styleParagraph)) {
         $objWriter->startElement('w:pPr');
         $objWriter->startElement('w:pStyle');
         $objWriter->writeAttribute('w:val', $styleParagraph);
         $objWriter->endElement();
         $objWriter->endElement();
     }
     if (count($elements) > 0) {
         foreach ($elements as $element) {
             if ($element instanceof PHPWord_Section_Text) {
                 $this->_writeText($objWriter, $element, true);
             } elseif ($element instanceof PHPWord_Section_Link) {
                 $this->_writeLink($objWriter, $element, true);
             }
         }
     }
     $objWriter->endElement();
 }
コード例 #2
0
ファイル: BaseTemplate.php プロジェクト: pscheit/psc-cms-word
 /**
  * Fügt dem Aktuellen Run Text hinzu
  *
  * der run muss zuerst mit newRun erstellt werden
  * Nach dem Text wird nicht umgebrochen (es sei denn ein neuer Run wird begonnen)
  */
 public function addRunText($text, $style = NULL, $pStyle = NULL)
 {
     return $this->run->addText($text, $style, $pStyle);
 }