Symfony Process LaTeX PDF文档生成失败

时间:2019-06-19 07:21:13

标签: laravel symfony pdf pdflatex symfony-process

我正在使用Laravelpdf系统上借助LaTeXpdflatex)创建windows 10文档。

我有这种方法来生成pdf文件:

public function pdfErzeugen() {
    $process = new \Symfony\Component\Process\Process('"' .str_replace('/','\\',env('PDFLATEXENGINE', 'C:/Program Files (x86)/MiKTeX 2.9/miktex/bin/pdflatex.exe')) .'" "' .str_replace("\\", "/", str_replace(".tex","",$this->latexFilePath)) .'" -output-directory="' .str_replace("\\", "/", $this->outputDirectory) .'"');
    $process->setEnhanceWindowsCompatibility(false);
    $process->run();
    if (!$process->isSuccessful()) {
        throw new \Symfony\Component\Process\Exception\ProcessFailedException($process);
    }
}

实际上,此错误总是来自laravel.log

  

[2019-06-19 09:02:04]本地信息:53 [2019-06-19 09:02:04]   本地信息:2019-06-19 08:56:14 [2019-06-19 09:02:04]本地信息:
  [2019-06-19 09:02:04]本地.INFO:2019-06-19 09:02:04 [2019-06-19   09:02:04] local.INFO:53 [2019-06-19 09:02:05] local.ERROR:   Symfony \ Component \ Process \ Exception \ ProcessFailedException:   命令““ C:\ Program Files(x86)\ MiKTeX 2.9 \ miktex \ bin \ pdflatex.exe”   “ D:/文件/公司/ Kunden /客户/软件/应用/类/ Rechnung / LaTex / Output / Rechnung_DY58MPGlGgoWv1ATzJL8_000053-19”   -output-directory =“ D:/ Files / Company / Kunden / Customer / Software / app / Classes / Rechnung / LaTex / Output /”“   失败。

     

退出代码:1(一般错误)

     

工作目录:D:\ Files \ Company \ Kunden \ Customer \ Software \ public

     

输出:

     

错误输出:   ==============在D:\ Files \ Company \ Kunden \ Customer \ Software \ app \ Classes \ Rechnung \ KaufAufRechnung.php:123中   ...

到目前为止,很好(或不好)。但是现在发生了一件奇怪的事情。 当我选择并运行命令时:

"C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\pdflatex.exe" "D:/Files/Company/Kunden/Customer/Software/app/Classes/Rechnung/LaTex/Output/Rechnung_DY58MPGlGgoWv1ATzJL8_000053-19" -output-directory="D:/Files/Company/Kunden/Customer/Software/app/Classes/Rechnung/LaTex/Output/"

在控制台中,pdf文件的生成没有错误。 有谁知道我可以从哪里开始搜索错误?可以是授权问题吗?与将命令放入console中时相比,网络服务器在不同的帐户上运行。 非常感谢您提前提供每个提示!

更新:

setEnhanceWindowsCompatibility设置为true:

$process->setEnhanceWindowsCompatibility(true);

更新2:start类的symfony-process函数中,我看到正在生成此命令以启动该过程:

cmd /V:ON /E:ON /D /C "("C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\pdflatex.exe" "D:/Files/Company/Kunden/Customer/Software/app/Classes/Rechnung/LaTex/Output/Rechnung_iHpVNRyUffzgfBj1w3xj_000053-19" -output-directory="D:/Files/Company/Kunden/Customer/Software/app/Classes/Rechnung/LaTex/Output/")"

当我使用windows -> run执行此命令时,它还会创建我的pdf文件。它让我发疯...

0 个答案:

没有答案
相关问题