Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP LaTeX to PDF Conversion/Compiling [closed]

Tags:

php

pdf

latex

tex

I have searched far and wide to find a PHP-based tool to convert LaTeX to PDF, but have had no success. I understand that LaTeX runs on the server side, however I still require a PHP-based command process in order to generate said PDF files using LaTeX.

Edit

Additionally, installing binaries, libraries or tools on to the server is a no-no. The tool at my disposal is PHP and the functionalities it has built in. Any class or PHP tool that can convert LaTex to PDF is incredibly useful.

Any guidance would be most appreciated.

like image 535
nderjung Avatar asked Feb 03 '23 10:02

nderjung


1 Answers

i just installed the package texlive-binaries and used a shell exec with the pdflatex command to generate the PDF from a (La)TeX file:

shell_exec("/usr/bin/pdflatex --interaction batchmode $filename");

i know this is not what you asked for but i don't know of a php lib as complete as the already existing latex compilers.

why reinvent the wheel anyways?

Update: When you have enough space, install textlive-full instead of texlive-binaries. This will install all the available packages, fonts, etc. and avoid you some headache why your document renders wrong.

like image 82
Kaii Avatar answered Feb 05 '23 07:02

Kaii