Hi all,
I am trying to use the PHP API, however I don't seem to be able to get any results at all.
Prince is installed on Centos x64 using prince-8.0-linux-amd64-static.tar.gz. Installed to /usr/local/ and is working via ssh command line.
I do get some when I generate a pdf:
But I suspect it is just unsporrted/incorrect HTML? because the PDF is generated.
I have had no success with the PHP however... I am sorry if this is completely wrong.
Returns.
Where am I going wrong?
I am trying to use the PHP API, however I don't seem to be able to get any results at all.
Prince is installed on Centos x64 using prince-8.0-linux-amd64-static.tar.gz. Installed to /usr/local/ and is working via ssh command line.
I do get some when I generate a pdf:
prince http://www.google.com -o google.pdf
prince: http://www.google.com:8: error: htmlParseEntityRef: no name
prince: http://www.google.com:8: error: htmlParseEntityRef: expecting ';'
prince: http://www.google.com:8: error: Tag nobr invalid
But I suspect it is just unsporrted/incorrect HTML? because the PDF is generated.
I have had no success with the PHP however... I am sorry if this is completely wrong.
<?php
require_once('prince.class.php');
$prince = new Prince('/usr/local/bin/prince');
$path = "http://www.google.com";
$convert = $prince->convert_file($path);
if($convert === true) {
echo "Success";
} elseif($convert === false) {
echo "Fail:<br><br>";
} else {
echo "Wha?:<br> ";
echo $convert . "<br>";
}
print_r($prince);
?>
Returns.
Fail:
Prince Object ( [exePath:private] => /usr/local/bin/prince [styleSheets:private] => [isHTML:private] => [baseURL:private] => [doXInclude:private] => 1 [httpUser:private] => [httpPassword:private] => [logFile:private] => [embedFonts:private] => 1 [compress:private] => 1 [encrypt:private] => [encryptInfo:private] => )
Where am I going wrong?