PhpRtf Lite 0.2.0 released
Sunday, August 12th, 2007Some very strong bugs fixed.
Note: It’s possible, that after updating, your code which is using library will throw errors, and should be refactored.
• Documents with tables generated using PhpRtf Lite crashed in Microsoft Word 2000. Fix in Table::getContent method.
• Removed all call-times pass-by-reference from the library. Because with allow_call_time_pass_reference = false setting in php.ini, warnings were frown.
Also is changed Container::writeText() method declaration. Instead of variables are used instances:
Old declaration:
function writeText($text, $font, $parFormat = false, $replaceTags = true);
New declaration:
function writeText($text, &$font, &$parFormat, $replaceTags = true)
PHP 4 doesn’t let writing &$parFormat = 0 in declaration. So after updating library, your code, which is using library, should be refactored.
Instead of writing:
$sect->writeText(‘RTF PHP’, new Font());
or
$section->writeText(‘RTF PHP’, new Font(), false);
You have to write:
$null = null;
$sect->writeText(‘RTF PHP’, new Font(), $null);
As third argument is used null reference. Look at the samples for more information.
• Also removed possibility to use <page> and <section> tags in Container:writeText() method.
Instead of using <section>, you should create new section. Instead of using <page> tag, you should use Section::insertPageBreak() method (that’s done, because, page breaking shouldn’t be used in headers, footers and cells).