rtf-html-php icon indicating copy to clipboard operation
rtf-html-php copied to clipboard

Parse error: RTF text outside of group

Open petardfoozer opened this issue 5 years ago • 4 comments

I am getting this error after my rtf document is converted and I'm moving on to a new document to convert

$document = new \RtfHtmlPhp\Document($note_object->rtf);
$formatter = new \RtfHtmlPhp\Html\HtmlFormatter('UTF-8');
$plain_text = (strip_tags($formatter->Format($document)));

after I convert my rtf document to plain text, I'm then sending it through sftp, but when I move on to the next document to convert, it crashes with the message 'Parse error: RTF text outside of group'

I'm not sure what is causing this as I know that the object being send into the formatter is indeed RTF

More debug info:

Trace:
	Array
	(
	    [0] => Array
	        (
	            [args] => Array
	                (
	                    [0] => 1024
	                    [1] => Parse error: RTF text outside of group.
	                    [2] => /var/www/html/mysite/vendor/henck/rtf-to-html/src/Document.php
	                    [3] => 286
	                    [4] => Array
	                        (
	                            [text] => RtfHtmlPhp\Text Object
	                                (
	                                    [text] => This was created by the edito
	                                )

	                            [terminate] =>
	                            [err] => Parse error: RTF text outside of group.
	                        )

	                )

	        )

	    [1] => Array
	        (
	            [file] => /var/www/html/mysite/vendor/henck/rtf-to-html/src/Document.php
	            [line] => 286
	            [function] => trigger_error
	            [args] => Array
	                (
	                    [0] => Parse error: RTF text outside of group.
	                )

	        )

	    [2] => Array
	        (
	            [file] => /var/www/html/mysite/vendor/henck/rtf-to-html/src/Document.php
	            [line] => 326
	            [function] => ParseText
	            [class] => RtfHtmlPhp\Document
	            [type] => ->
	            [args] => Array
	                (
	                )

	        )

	    [3] => Array
	        (
	            [file] => /var/www/html/mysite/vendor/henck/rtf-to-html/src/Document.php
	            [line] => 17
	            [function] => Parse
	            [class] => RtfHtmlPhp\Document
	            [type] => ->
	            [args] => Array
	                (
	                    [0] => This was created by the editor
	                )

	        )

	    [4] => Array
	        (
	            [file] => /var/www/html/mysite/private/Controllers/Jobs/Healthelink/Dischargesummary.php
	            [line] => 105
	            [function] => __construct
	            [class] => RtfHtmlPhp\Document
	            [type] => ->
	            [args] => Array
	                (
	                    [0] => This was created by the editor
	                )

	        )

petardfoozer avatar May 14 '20 20:05 petardfoozer

Hi @petardfoozer ,I'm getting the same issue. Did you find some fix?

wildrove avatar May 20 '20 13:05 wildrove

Hi @petardfoozer , @wildrove , I'm getting the same issue. Did you find some fix?

MelaniaBB avatar Aug 04 '20 12:08 MelaniaBB

Hi @petardfoozer , @wildrove, @MelaniaBB , I'm getting the same issue. Did you find some fix?

yarovskiy avatar Nov 13 '20 20:11 yarovskiy

The issue was with my RTF, not the library. It's most likely a problem with your data

petardfoozer avatar Nov 14 '20 04:11 petardfoozer