summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/confproc/papersinfo.sh
blob: 61c444520d7a28d1ba361948e5d49caf6fb63c87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash

args=("$@")
GPATH=${args[0]} #= ~/proceedings/e-proceedings
TEXFILE=${args[1]} #= ICMC2009_proceedings
INPATH=${args[2]} #= papers_info
SPPATH=${args[3]} #= papers_split
PDFPATH=${args[4]} #= ~/proceedings/e-proceedings
PDFTKPATH=${args[5]} #= ~/pdftk_info

PDFFILE=${TEXFILE}.pdf     # for use in the paper_split.sh and paper_info.sh scripts

cd ${GPATH}/${SPPATH}
filelist=`ls *.pdf`
mkdir ${PDFPATH}

cd ${GPATH}
chmod +x removeLaTeXcmds.sh

for file in $filelist
do
  base=${file%%.*}
  echo "removing LaTeX accents: ${base}.pdftk -> ${base}_clean.info"
#  echo "cmd: removeLaTeXcmds.sh ${GPATH} ${PDFTKPATH}/${base}.pdftk ${INPATH}/${base}_clean.info"
  ${GPATH}/removeLaTeXcmds.sh ${GPATH} ${PDFTKPATH}/${base}.pdftk ${INPATH}/${base}_clean.info
  echo "adding PDF metadata:    ${base}_clean.info -> ${base}.pdf"
#  echo "cmd: pdftk ${SPPATH}/${base}.pdf update_info ${INPATH}/${base}_clean.info output ${PDFPATH}/${base}.pdf"
  echo "pdftk ${GPATH}/${SPPATH}/${base}.pdf update_info ${GPATH}/${INPATH}/${base}_clean.info output ${PDFPATH}/${base}.pdf"
  pdftk ${GPATH}/${SPPATH}/${base}.pdf update_info ${GPATH}/${INPATH}/${base}_clean.info output ${PDFPATH}/${base}.pdf
done