I'm excited about this product, but I'm having no luck at all either converting or streaming docs at PDF files. I have installed and used many server-based products and PHP add-ons before, and I just spent two hours trying to figure out what I'm doing wrong, so hopefully it's something simple.
I installed prince on Ubuntu 7.10 with no errors. The executable is located in the /usr/lib/prince/bin folder.
I installed the prince.php file for PHP integration.
I created a simple XHTML document that validates fine, and all it contains in the body is a single "hello world" div.
The PHP file that attempts to convert this file looks like this:
When this PHP file executes, the $errs array contains this:
I've tried setting the permissions of the /usr/lib/prince/bin folder, and the prince executable, to 777, but that didn't work.
I had a whole other (but equally unsuccessful) experience trying to get the file to "passthru" to the browser-- everything from MIME type errors to completely empty files with text/plain MIME types. Never a PDF.
Any suggestions? Is there setup documentation somewhere that I might've missed? I read the readme.html file, and checked the documentation here on the site, but I'm at my wit's end.
Thanks in advance,
-Josh
I installed prince on Ubuntu 7.10 with no errors. The executable is located in the /usr/lib/prince/bin folder.
I installed the prince.php file for PHP integration.
I created a simple XHTML document that validates fine, and all it contains in the body is a single "hello world" div.
The PHP file that attempts to convert this file looks like this:
<?php
require_once 'prince.php';
$prince = new prince('/usr/lib/prince/bin');
$prince->setHTML(false);
$errs = array();
if ($prince->convert_file_to_file('/home/josh/www/domain/file.html', '/home/josh/Desktop/pdftest.pdf', $errs) {
echo 'Report OK!';
} else {
var_dump($errs);
}
?>
When this PHP file executes, the $errs array contains this:
array(1) { [0]=> array(1) { [0]=> string(38) "/usr/lib/prince/bin: Permission denied" } }
I've tried setting the permissions of the /usr/lib/prince/bin folder, and the prince executable, to 777, but that didn't work.
I had a whole other (but equally unsuccessful) experience trying to get the file to "passthru" to the browser-- everything from MIME type errors to completely empty files with text/plain MIME types. Never a PDF.
Any suggestions? Is there setup documentation somewhere that I might've missed? I read the readme.html file, and checked the documentation here on the site, but I'm at my wit's end.
Thanks in advance,
-Josh
Edited by Josh Prowse