Convert / compile PHP LaTeX to PDF

I searched everywhere to find a PHP tool to convert LaTeX to PDF, but was not successful. I understand that LaTeX works on the server side, however I still need a PHP-based team process to create the specified PDF files using LaTeX.

Edit

In addition, installing binary files, libraries, or tools on the server is no-no. The tool at my disposal is PHP and its functionality. Any PHP class or tool that can convert LaTex to PDF is incredibly useful.

Any recommendations would be most appreciated.

+8
php pdf latex tex
source share
3 answers

I just installed the texlive-binaries package and used the exec shell with the pdflatex command to create a PDF file 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 how php lib is as complete as existing latex compilers.

why reinvent the wheel anyway?

Update:. When you have enough space, install textlive-full instead of texlive-binaries . This will install all available packages, fonts, etc. And to avoid any headache, why your document is wrong.

+12
source share

If you cannot change the server setting to install the server package for LaTeX, you cannot convert LaTeX files to PDF ...

but what can you check to convert directly to PDF without LaTeX, but it depends on what you like? It may seem worthy ... fpdf ...

0
source share

this is my example: name: phplatex.php

 <?php $data = shell_exec('/Library/TeX/texbin/pdflatex --interaction=nonstopmode -output-directory=/Users/arico/a/destino /Users/arico/a/fuente/prueba.tex'); echo ('Latex: ' . $data . ''); ?> 

pdflatex executable path: / Library / TeX / texbin / pdflatex

path of the output file in pdf format: (you need permissions to write) -output-directory = / Users / Arico / / Destino

latex source file path: /Users/arico/a/fuente/prueba.tex

0
source share

All Articles