We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e6b4c48 + 8c0c058 commit 9bcabd6Copy full SHA for 9bcabd6
2 files changed
index.php
@@ -0,0 +1,16 @@
1
+<?php
2
+ error_reporting(-1);
3
+ ini_set('display_errors', 'on');
4
+ require_once __DIR__ . '/vendor/autoload.php';
5
+
6
+ use RtfHtmlPhp\Document;
7
+ use RtfHtmlPhp\Html\HtmlFormatter;
8
9
+ $original = file_get_contents("tests/rtf/hello-world.rtf");
10
11
+ $document = new Document($original); // or use a string directly
12
+ $formatter = new HtmlFormatter('UTF-8');
13
+ $r = $formatter->Format($document);
14
+ file_put_contents('rtf.html', $r);
15
+ echo $r;
16
+?>
src/Document.php
@@ -302,7 +302,7 @@ protected function Parse(string $rtf)
302
$this->group = null;
303
$this->root = null;
304
305
- while($this->pos < $this->len)
+ while($this->pos < $this->len-1)
306
{
307
// Read next character:
308
$this->GetChar();
0 commit comments