This commit is contained in:
Andreas Moik
2016-07-28 16:55:09 +02:00
parent bf70eedc27
commit b820f409aa
2 changed files with 6 additions and 9 deletions
+2 -5
View File
@@ -69,7 +69,6 @@ foreach($prestudent_ids as $pid)
cleanUpAndDie($p->t('tools/studentWurdeNichtGefunden')."(".$pid.")", $tmpDir);
/*
* Get all Documents
*/
@@ -108,7 +107,6 @@ foreach($prestudent_ids as $pid)
if($filename == "")
continue;
/*
* Determine the filetype
* and convert, if nessecary
@@ -148,15 +146,14 @@ foreach($prestudent_ids as $pid)
if(!$doc->create('pdf'))
die($doc->errormsg);
$document = $doc->output(false);
$filename = $tmpDir.'/'.uniqid();
file_put_contents($filename, $document);
file_put_contents($filename, $doc->output(false));
$doc->close();
$allDocs[] = $filename;
$allDocs = array_merge($allDocs, $preDocs);
unset($doc);
}
/*
* generate the merged PDF
*/
+4 -4
View File
@@ -168,7 +168,7 @@ class dokument_export
$contentbuffer = $proc->transformToXml($this->xml_data);
$this->temp_folder = '/tmp/fhcunoconv-'.uniqid();
$this->temp_folder = sys_get_temp_dir().'/fhcunoconv-'.uniqid();
mkdir($this->temp_folder);
chdir($this->temp_folder);
file_put_contents('content.xml', $contentbuffer);
@@ -201,7 +201,8 @@ class dokument_export
if(!$vorlage_found)
$zipfile = DOC_ROOT.'system/vorlage_zip/'.$this->vorlage_file;
$tempname_zip = 'out.zip';
$tempname_zip = $this->temp_folder . '/out.zip';
if(!copy($zipfile, $tempname_zip))
die('copy failed');
@@ -254,7 +255,7 @@ class dokument_export
switch($this->outputformat)
{
case 'pdf':
$this->temp_filename='out.pdf';
$this->temp_filename = $this->temp_folder . '/out.pdf';
exec("unoconv -e IsSkipEmptyPages=false --stdout -f pdf $tempname_zip > ".$this->temp_filename, $out, $ret);
if($ret!=0)
@@ -408,7 +409,6 @@ class dokument_export
$command = 'unoconv --format %s --output %s %s';
$command = sprintf($command, $format, $outFile, $inFile);
exec($command, $out, $ret);
if($ret!=0)
{