ismaelw / laratex

A Laravel package for creating PDF files using LaTeX
MIT License
105 stars 13 forks source link

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (MiKTeX 22.7.30) (preloaded format=pdflatex.fmt) restricted \write18 enabled. #8

Closed MrBaker10 closed 2 years ago

MrBaker10 commented 2 years ago

I want to run dryRun(), but get the errormessage above. May you can explain me why. Pdflatex works.

Controller public function download(){ return (new LaraTeX)->dryRun(); }

web.php Route::controller(FinposController::class)->group(function () { Route::get('download', 'download')->name('finpos_download'); });

latex.php

<?php

return [ // bin path to your pdflatex installation | use 'which pdflatex' on a linux system to find out which is the path to your pdflatex installation 'binPath' => 'pdflatex', // binPath' => 'c:\Users\itbaecker\AppData\Local\Programs\MiKTeX\miktex\bin\x64\pdflatex',

// Folder in your storage folder where you would like to store the temp files created by LaraTeX
'tempPath' => 'app/laratex',

// boolean to define if log, aux and tex files should be deleted after generating PDF
'teardown' => true,

];

ismaelw commented 2 years ago

Hi @MrBaker10

Thank you for your message. Seeing your error message it seems like there is an issue in either my dryrun.tex file or with your pdflatex installation.

But because you receive a tex error I guess we can skip the dryrun part and try right away to render something small and save.

Could you try to create a blade file like test.blade.php and add a simple tex hello world document syntax like this:

\documentclass{article}

\begin{document}
Hello, World!
\end{document}

and then try to download this as a PDF

use Ismaelw\LaraTeX\LaraTeX;
...
return (new LaraTeX('test'))->download('test.pdf');

If this works then it might be an issue with my dryrun code and if it also doesn't work we might have to check further possible issues.

Kind regards, Ismael

ismaelw commented 2 years ago

Hi @MrBaker10

Have you been able to test my approach? Is there anything I can assist you with?

Kind regards, Ismael

MrBaker10 commented 2 years ago

I am very sorry for the late reply. It was due to my installation of texlive. But thank you very much for your effort.

ismaelw commented 2 years ago

Hi @MrBaker10

No worries. I am glad that you could sort out the issues. If you have any further questions you can always contact me.