$pos = explode(':', $_SERVER['DOCUMENT_ROOT']);
$disk = $pos[0];
//$libreoffice = $disk.': && '.$disk.':/paperless/LibreOffice5/program/soffice.exe';
//$command = "soffice --headless --convert-to pdf:writer_pdf_Export --outdir " . $outpath . " " . $inpath;
$command = "soffice --headless --invisible --convert-to pdf ".$inpath." --outdir " . $outpath." 2>&1";
//$command = "soffice --headless --invisible --convert-to pdf /usr/local/apache/htdocs/webserver/ftp/44.doc --outdir /usr/local/apache/htdocs/webserver/ftp/ 2>&1 ";
file_put_contents("/usr/local/apache/htdocs/log/1.log",$command,FILE_APPEND);
$res = exec($command,$a,$return_val);
file_put_contents("/usr/local/apache/htdocs/log/1.log",json_encode($a).$return_val,FILE_APPEND);
return true;