| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function docbook_convertToPdfFromXml { |
| |
| |
| if [[ -f ${FILE}.sgml.pdf ]];then |
| cli_printMessage "${FILE}.xml.pdf" --as-updating-line |
| else |
| cli_printMessage "${FILE}.xml.pdf" --as-creating-line |
| fi |
| |
| local -a STYLE_TEMPLATE |
| local -a STYLE_INSTANCE |
| local STYLE_INSTANCE_FINAL='' |
| |
| |
| |
| local TMPDIR=$(cli_getTemporalFile "docbook2pdf") |
| |
| |
| |
| |
| local SRC=${INSTANCE} |
| |
| |
| |
| |
| local DST="${FILE}.xml.pdf" |
| |
| |
| |
| local FO=$(basename ${FILE}).fo |
| |
| |
| |
| local PDF=$(basename ${FILE}).pdf |
| |
| |
| ${RENDER_BACKEND}_prepareStyles "${DOCBOOK_STYLES_DIR}/docbook2fo.xsl" |
| |
| |
| if [[ ! -d $TMPDIR ]];then |
| mkdir $TMPDIR |
| fi |
| |
| |
| pushd $TMPDIR > /dev/null |
| |
| |
| xsltproc --output ${FO} ${STYLE_INSTANCE_FINAL} ${SRC} &> /dev/null |
| |
| |
| |
| |
| |
| if [[ $? -eq 0 ]];then |
| pdfxmltex ${FO} > /dev/null |
| pdfxmltex ${FO} > /dev/null |
| else |
| cli_printMessage "`gettext "Cannot produce the formatting object."`" --as-error-line |
| fi |
| |
| |
| |
| if [[ $? -eq 0 ]];then |
| mv $PDF $DST |
| else |
| cli_printMessage "`gettext "Cannot produce the PDF file."`" --as-error-line |
| fi |
| |
| |
| popd > /dev/null |
| |
| |
| rm -r $TMPDIR |
| rm ${STYLE_INSTANCE[*]} |
| |
| } |