Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #26572

    on my local windows computer works great, but on my remote linux server don’t.

    i use this code on linux
    java -Xmx512m -Djava.awt.headless=true -cp pd4ml_demo.jar Pd4Cmd ‘http://sierrasolutions.com.mx/cfdi/timbrada_cfdi.php?hola=65’ 1000 LETTER -debug -out 1.pdf

    #28561

    Do you call the command from shell or from PHP script?

    How does the error expose itself?

    #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

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘General questions / FAQ’ is closed to new topics and replies.