Forum How do I...?

Prince XML in Code Ignitor

rjacobsen
Let me first explain what I have done, and then what the problem is.

I am currently working in CodeIgniter. I have created the Prince class, and call the class with the following code:

$this->load->library('prince',array('C:\Program Files (x86)\Prince\Prince.exe'));
$this->prince->setLog(getcwd().'\\prince\\logs\\error.log');
$this->prince->addStyleSheet(getcwd().'\\css\\products_css\\dental-ortho.css');
$this->prince->addStyleSheet(getcwd().'\\css\\products_css\\fonts.css');
$this->prince->setHTML(true);
$this->prince->setBaseURL(getcwd().'\\products\\html\\dental-ortho.html');
$this->prince->setEmbedFonts(true);
$this->prince->convert2(getcwd().'\\products\\html\\dental-ortho.html',getcwd().'\\products\\pdf');


The code above runs, but doesnt spit out any errors (that I can see), but does not create a PDF. Any help would be appreciated.
mikeday
Is any log file created? If not, can you try specifying a log directory that you know is writable from PHP, like a temporary file directory?
rjacobsen
I just made the log be written to the apache log directory, which I know is writable, and still no logs

It seems that a PDF is not being created because when I run:

$logFile = "C:\wamp\bin\apache\Apache2.2.17\logs\prince.log";
$cssFile1 = getcwd()."\css\products_css\dental-ortho.css";
$cssFile2 = getcwd()."\css\products_css\fonts.css";
$this->load->library('prince',array("C:\Program Files (x86)\Prince\Engine\bin\prince.exe"));
$this->prince->setLog($logFile);
$this->prince->addStyleSheet($cssFile1);
$this->prince->addStyleSheet($cssFile2);
$this->prince->setHTML(true);
$this->prince->setBaseURL(getcwd()."\products\html\dental-ortho.html");
$this->prince->setEmbedFonts(true);
$done = $this->prince->convert2(getcwd()."\products\html\dental-ortho.html",getcwd()."\products\pdf");
var_dump($done);


, done returns false
mikeday
Can you try temporarily moving the Prince installation to a directory that doesn't have a space in it?
jim_albright
Is it truly
Program Files (x86)
and not just
Program Files

Jim Albright
Wycliffe Bible Translators