summaryrefslogtreecommitdiff
path: root/php/latexToPdf.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2022-12-14 12:52:11 +0100
committerpolo <ordipolo@gmx.fr>2022-12-14 12:52:11 +0100
commita45a3e0345890b9df3c5fa7c82966a64491eca02 (patch)
treee56b328a497cc315095dbf7f513f2ceb76d4351b /php/latexToPdf.php
parenteda2e96c17d8d22cfc2615698efa5c757dbfb0a5 (diff)
downloadAppliGestionPHP-a45a3e0345890b9df3c5fa7c82966a64491eca02.zip
MODEL + reorganisation
Diffstat (limited to 'php/latexToPdf.php')
-rw-r--r--php/latexToPdf.php38
1 files changed, 0 insertions, 38 deletions
diff --git a/php/latexToPdf.php b/php/latexToPdf.php
deleted file mode 100644
index 18ff452..0000000
--- a/php/latexToPdf.php
+++ /dev/null
@@ -1,38 +0,0 @@
1<?php
2// php/latexToPdf.php
3
4// contenu
5$latex = '\documentclass{article}
6
7\usepackage[french]{babel}
8\usepackage[utf8]{inputenc}
9\usepackage[T1]{fontenc}
10
11\begin{document}
12 Bravo, ça compile !!
13\end{document}';
14
15$fileName = 'latex.tex';
16$latexPath = '';
17$pdfPath = '';
18
19//~ writeLatex($latex, $fileName, $latexPath);
20
21function latexToPdf(string $fileName, string $latexPath, string $pdfPath)
22{
23 $outputDir = '';
24 if($pdfPath !== '')
25 {
26 $outputDir = '-output-directory=' . $pdfPath . ' ';
27 }
28
29 // compilation
30 exec('pdflatex ' . $outputDir . $latexPath . $fileName);
31
32 // nettoyage
33 $basename = basename($fileName, '.tex');
34 unlink($pdfPath . $basename . '.aux');
35 unlink($pdfPath . $basename . '.log');
36}
37
38//~ latexToPdf($fileName, $latexPath, $pdfPath);