HI there,
I am having trouble applying a stylesheet to the generated PDF when called from PHP. After modifing the prince interface code to get around apache running as a less privileged user I started getting PDF reports but despite attempting lots of different ways of specifing the stylesheet, it never gets applied through my php code. The prince interface change I made was:
I added some debug to the php interface class to show me the command being run. Output is as follows:
I have run a similiar command from the command line, leaving out the server argument and adding the input/output arguments and everything works fine.
I have tried the following in my code
1.
2.
Interstingly, I can't get the code to produce an error log either (perhaps because the pdf is being created?) and even though I have also enabled the verbose (-v) option I am unable to debug what is going on.
Any help would be greatly appreciated as it seems like a pretty straightforward process but I'm obviously missing something...
Thanks in advance,
David
http://zambianmadness.blogspot.com/
I am having trouble applying a stylesheet to the generated PDF when called from PHP. After modifing the prince interface code to get around apache running as a less privileged user I started getting PDF reports but despite attempting lots of different ways of specifing the stylesheet, it never gets applied through my php code. The prince interface change I made was:
$process = proc_open(escapeshellcmd($pathAndArgs), $descriptorspec, $pipes, NULL, NULL,
array('bypass_shell' => TRUE));
I added some debug to the php interface class to show me the command being run. Output is as follows:
C:/Program Files/Prince/Engine/bin/prince.exe --server -s ^"C:/Documents and Settings/All Users/Documents/eclipse/svn/taonga/trunk/web/styles.css^" --input=html --log=^"C:^\Temp^\errors.log^" --silent -
I have run a similiar command from the command line, leaving out the server argument and adding the input/output arguments and everything works fine.
I have tried the following in my code
1.
$prince = new Prince('C:/Program Files/Prince/Engine/bin/prince.exe');
$prince -> setHTML(true);
$prince -> setBaseURL("http://127.0.0.1/taonga");
$prince -> addStyleSheet('http://127.0.0.1/taonga/styles.css');
$prince -> setLog("C:\\Temp\\errors.log");
$result = $prince -> convert_string_to_passthru($html);
2.
$prince = new Prince('C:/Program Files/Prince/Engine/bin/prince.exe');
$prince -> setHTML(true);
$prince -> addStyleSheet('C:/styles.css');
$prince -> setLog("C:\\Temp\\errors.log");
$result = $prince -> convert_string_to_passthru($html);
Interstingly, I can't get the code to produce an error log either (perhaps because the pdf is being created?) and even though I have also enabled the verbose (-v) option I am unable to debug what is going on.
Any help would be greatly appreciated as it seems like a pretty straightforward process but I'm obviously missing something...
Thanks in advance,
David
http://zambianmadness.blogspot.com/