HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › General questions / FAQ › localhost works, http don’t › Re: Re: localhost works, http don’t
June 20, 2011 at 20:06
#28562
<?
....
....
....
$evaluation = 1;
$java = "java";
$url = getUrlBase() . "timbrada_cfdi.php";
$file = "test1.pdf";
if ( $evaluation == 1 ) {
$jar = 'pdf/pd4ml_demo.jar';
} else {
$jar = "pdf/pd4ml.jar";
}
if ( strpos(php_uname(), 'Windows' ) !== FALSE) {
// server platform: Windows
$jar = preg_replace('///', "\", $jar);
$cmdline = "$java -Xmx512m -cp $jar Pd4Cmd '$url' 1000 LETTER -debug -out $file";
echo $cmdline;
} else {
// server platform: UNIX-derived
$cmdline = "$java -Xmx512m -Djava.awt.headless=true -cp $jar Pd4Cmd '$url' 1000 LETTER -out $file";
echo $cmdline;
}
// see for more command-line parameters: https://pd4ml.com/html-to-pdf-command-line-tool.htm
passthru($cmdline, $result);
echo "".$result;
....
....
....
....
?>
on my localhost i get $result = 1, but on my http i get $result = 127
