summaryrefslogtreecommitdiff
path: root/backends/pdf
diff options
context:
space:
mode:
Diffstat (limited to 'backends/pdf')
-rw-r--r--backends/pdf31
1 files changed, 31 insertions, 0 deletions
diff --git a/backends/pdf b/backends/pdf
new file mode 100644
index 0000000..d292f46
--- /dev/null
+++ b/backends/pdf
@@ -0,0 +1,31 @@
+# Backend to convert something into PDF
+# Send any comments to Eric Bischoff <eric@caldera.de>
+# This program is under GPL license. See LICENSE file for details.
+
+TEXINPUTS="$(dirname "${SGML_FILE}"):${TEXINPUTS}"
+export TEXINPUTS
+
+# Convert to TeX
+$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS
+if [ $? -ne 0 ]
+then exit 1
+fi
+
+# Convert from TeX to PDF
+pdfjadetex ${SGML_FILE_NAME}.tex >${SGML_FILE_NAME}.tmp
+if [ $? -ne 0 ]
+then
+ cat ${SGML_FILE_NAME}.tmp
+ rm ${SGML_FILE_NAME}.tmp
+ rm ${SGML_FILE_NAME}.tex
+ exit 2
+fi
+rm ${SGML_FILE_NAME}.tmp
+
+# Unconditionally re-run pdfjadetex, twice
+pdfjadetex ${SGML_FILE_NAME}.tex >/dev/null
+pdfjadetex ${SGML_FILE_NAME}.tex >/dev/null
+rm -f ${SGML_FILE_NAME}.log ${SGML_FILE_NAME}.aux \
+ ${SGML_FILE_NAME}.tex ${SGML_FILE_NAME}.out
+
+exit 0