Forum Bugs

I'm only able to generate simple HTML (PHP + Prince + Ubuntu) [solved]

maktouch
Hey all,
My specs:
Ubuntu 12.10.
Prince 8.1 rev 5.
PHP-FPM 5.4.15 w/ Nginx

Here is my problem:

        $a = '<b> heyhey </b>';
	$prince = new PrinceWrapper('/usr/bin/prince');
	$b = $prince->convert_string_to_passthru($a);	
	var_dump($b);

This returns true, it works. So far, so good.


        $a = '<b> heyhey </b> <b> WHAT </b>';
	$prince = new PrinceWrapper('/usr/bin/prince');
	$b = $prince->convert_string_to_passthru($a);	
	var_dump($b);


This returns false, it doesn't work .

I have used Prince in the past (v7) and this never happened. I'm trying to convince my boss to shell out the cash to buy the licenses but I can't even generate a simple invoice =|...


Thanks


-- edit
I enabled the log. This is what's written

Thu May 23 11:34:49 2013: ---- begin
Thu May 23 11:34:49 2013: Loading document...
Thu May 23 11:34:49 2013: -:1: error: Extra content at the end of the document
Thu May 23 11:34:49 2013: -: error: could not load input file
Thu May 23 11:34:49 2013: error: no input documents to process
Thu May 23 11:34:49 2013: finished: failure
Thu May 23 11:34:49 2013: ---- end


-- edit #2
Wow, I just wrote

$prince->setHTML(true);


And it seems to work... I thought it was on by default. =| Well.. this is solved.
mikeday
Sorry for the inconvenience! This issue affects the convert_string methods, which currently default to XML. We plan to change the default to HTML in the next release of Prince, it's more sensible. :)
mikeday
Prince 9 is now available, and we have changed the default behaviour to assume that unnamed documents are HTML, not XML. It makes sense. :)