Blame view

export/PHPRtfLite-1.3.1/samples/hello_world.php 437 Bytes
f90e19c3   Andrea Petta   plugin update
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  <?php
  
  $dir = dirname(__FILE__);
  require_once $dir . '/../lib/PHPRtfLite.php';
  
  // register PHPRtfLite class loader
  PHPRtfLite::registerAutoloader();
  
  $rtf = new PHPRtfLite();
  $sect = $rtf->addSection();
  $sect->writeText('<i>Hello <b>world</b></i>.', new PHPRtfLite_Font(12), new PHPRtfLite_ParFormat(PHPRtfLite_ParFormat::TEXT_ALIGN_CENTER));
  
  // save rtf document
  $rtf->save($dir . '/generated/' . basename(__FILE__, '.php') . '.rtf');