Using the following code:
I always get the message "Failed to generate PDF from provided HTML." I tried using setLog() (with a file the PHP user has write access to) to get more detailed errors, but nothing is written to the log.
However, I am able to open the Prince GUI as the PHP user and generate PDFs just fine from the same HTML.
I delved deeper into the prince.php wrapper to see where the error was occurring. In the convert_internal_file_to_passthru function, the call to proc_open appears to be working because the following is_resource check is true. However, the $result variable does not equal 'success'.
In the readMessages function, I added the following code at line 700:
I now get "$line is The current directory is invalid." in my output. What could be causing this error? My hunch is that there is some permissions issue, but if so I'm not sure what it is.
$prince = new \Prince('C:\Program Files (x86)\Prince\Engine\bin\prince.exe');
if ($prince->convert_string_to_passthru($html) !== true) {
echo "Failed to generate PDF from provided HTML";
}
I always get the message "Failed to generate PDF from provided HTML." I tried using setLog() (with a file the PHP user has write access to) to get more detailed errors, but nothing is written to the log.
However, I am able to open the Prince GUI as the PHP user and generate PDFs just fine from the same HTML.
I delved deeper into the prince.php wrapper to see where the error was occurring. In the convert_internal_file_to_passthru function, the call to proc_open appears to be working because the following is_resource check is true. However, the $result variable does not equal 'success'.
In the readMessages function, I added the following code at line 700:
echo '$line is ' . $line;
I now get "$line is The current directory is invalid." in my output. What could be causing this error? My hunch is that there is some permissions issue, but if so I'm not sure what it is.