first of all, this is a great app mainly because it doesn't pretend to do too much. i like the fact that there are only 4 ways to work the conversion -- that's really all that's necessary imo -- and the config options are few and simple. there's a lot to be said for the K.I.S.S. approach, so nice job.
so . . . i've tried this a couple different ways, but ultimately, the pdf either isn't being saved to webserver or it's data isn't being handled by prince i'm not sure which . . .
what i have now is a complete webpage that generates content (display.php) and a script to convert that webpage (vert.php). so the theory is that when i'm ready to output the display to pdf, i'll run the converter directly.
i've included the php library made some configs and added the additional header (some bits have been changed to protect the elderly)
then i run the thing with a little error handling.
in the end what happens is that the converter seems to run, spawns the pdf reader, then gives the error msg File does not begin with '%PDF-'. ultimately, there's no file. there is no error echo and there is no entry to the logfile. when i remove the header, the error echo is "Boo." (as above) with empty data.
I've also tried convert_string_to_passthru and convert_string_to_file with variations on the above setup. for string to passthru i using an example from here http://www.princexml.com/bb/viewtopic.php?t=1651&highlight=php . . . everything has performed the same as above.
at this point i'm just looking for suggestions. thanks in advance.
[edit] i understand the controls on the site to prevent spam, but man... annoying... especially since it was saying i had a url in the text that i couldn't find.
so . . . i've tried this a couple different ways, but ultimately, the pdf either isn't being saved to webserver or it's data isn't being handled by prince i'm not sure which . . .
what i have now is a complete webpage that generates content (display.php) and a script to convert that webpage (vert.php). so the theory is that when i'm ready to output the display to pdf, i'll run the converter directly.
i've included the php library made some configs and added the additional header (some bits have been changed to protect the elderly)
require_once ('/home/users/. . ./prince-6.0r8-linux/prince-php5-r5/prince.php');
//call and use prince
$prince = new Prince('/usr/local/bin/prince');
//configure
$prince->setHTML(1);
$prince->setLog('/var/vhosts/domain.com/logs/prince.log'); << permissions 666
$prince->addStyleSheet('/var/vhosts/domain.com/html/style.css');
$prince->setBaseURL('http://domain.com/');
header('Content-type: application/pdf');
then i run the thing with a little error handling.
$vert = $prince->convert_file_to_file("display.php", "/var/vhosts/domain.com/html/show.pdf", $msgs=array()); // converting display.php to a file
if ($vert === TRUE) {
echo "Yay." ;
} else {
echo "Boo.";
echo "err = " . $msgs['err'] . "<br>";
echo "wrn = " . $msgs['wrn'] . "<br>";
echo "inf = " . $msgs['inf'] . "<br>";
}
in the end what happens is that the converter seems to run, spawns the pdf reader, then gives the error msg File does not begin with '%PDF-'. ultimately, there's no file. there is no error echo and there is no entry to the logfile. when i remove the header, the error echo is "Boo." (as above) with empty data.
I've also tried convert_string_to_passthru and convert_string_to_file with variations on the above setup. for string to passthru i using an example from here http://www.princexml.com/bb/viewtopic.php?t=1651&highlight=php . . . everything has performed the same as above.
at this point i'm just looking for suggestions. thanks in advance.
[edit] i understand the controls on the site to prevent spam, but man... annoying... especially since it was saying i had a url in the text that i couldn't find.