예제 #1
0
 public function testConstruct()
 {
     $tpl = new MainTemplate();
     $tpl->addMarkupText('Dies ist ein kleiner aber schöner Test');
     $file = File::createTemporary();
     $tpl->write($file);
     $this->assertFileExists((string) $file);
     $file->delete();
 }
예제 #2
0
 public function __construct(InvoiceData $data, $runningNum = 1, PHPWord $word = NULL)
 {
     $this->invoice = $data;
     $this->num = $runningNum;
     parent::__construct($word);
     $this->word->setDefaultFontName('Verdana');
     $this->word->setDefaultFontSize(11);
     $this->word->addFontStyle('head.highlight', array('size' => 12, 'bold' => true));
     $this->word->addFontStyle('head', array('size' => 12));
     $this->word->addFontStyle('addressLine', array('size' => 6, 'underline' => \PHPWord_Style_Font::UNDERLINE_SINGLE));
     $this->word->addParagraphStyle('paddressLine', array('spacing' => 0, 'spaceAfter' => 82));
     $this->word->addFontStyle('recipient.highlight', array('size' => 10, 'bold' => true));
     $this->word->addFontStyle('recipient', array('size' => 10));
     $this->word->addFontStyle('date', array('size' => 9));
     $this->word->addFontStyle('text', array('size' => 11));
     $this->word->addFontStyle('headline', array('size' => 11.5, 'bold' => true));
     $this->word->addFontStyle('item', array('size' => 11));
     $this->word->addFontStyle('sum', array('size' => 11.5));
     $this->word->addFontStyle('sum.highlight', array('size' => 12, 'bold' => true));
 }