Ingen beskrivning

Sample_36_RTL.php 621B

12345678910111213141516171819
  1. <?php
  2. include_once 'Sample_Header.php';
  3. // New Word document
  4. echo date('H:i:s'), ' Create new PhpWord object', EOL;
  5. $phpWord = new \PhpOffice\PhpWord\PhpWord();
  6. $section = $phpWord->addSection();
  7. $textrun = $section->addTextRun();
  8. $textrun->addText(htmlspecialchars('This is a Left to Right paragraph.'));
  9. $textrun = $section->addTextRun(array('align' => 'right'));
  10. $textrun->addText(htmlspecialchars('سلام این یک پاراگراف راست به چپ است'), array('rtl' => true));
  11. // Save file
  12. echo write($phpWord, basename(__FILE__, '.php'), $writers);
  13. if (!CLI) {
  14. include_once 'Sample_Footer.php';
  15. }