2022-10-21 13:09:48 +02:00
|
|
|
# Use: sh convert-to-PDFX-3-2002.sh filename.pdf
|
|
|
|
|
|
|
|
bn=$(basename $1 ".pdf")
|
|
|
|
|
2022-06-09 10:08:24 +02:00
|
|
|
INPUT_PDF=$1
|
2022-10-21 13:09:48 +02:00
|
|
|
OUTPUT_PDF=$bn-PDFX-3-2022.pdf
|
2022-06-09 10:08:24 +02:00
|
|
|
|
|
|
|
# Make a tmp copy of the tex template with the input PDF filename
|
|
|
|
sed "s/XXX/$INPUT_PDF/g" xelatex-PDFX-3-2002.template.tex > xelatex-PDFX-3-2002.tmp.tex
|
|
|
|
|
|
|
|
# Run xelatex to convert the PDF to PDFX/3:2002
|
|
|
|
xelatex xelatex-PDFX-3-2002.tmp.tex
|
|
|
|
|
|
|
|
# Rename the output PDF
|
|
|
|
mv xelatex-PDFX-3-2002.tmp.pdf $OUTPUT_PDF
|
|
|
|
|
|
|
|
# Remove the tmp tex files
|
|
|
|
rm xelatex-PDFX-3-2002.tmp.*
|