From ab536d5678b8441f8830d5add1603d25f620f4fd Mon Sep 17 00:00:00 2001 From: fritz-hh Date: Sun, 5 May 2013 20:56:45 +0200 Subject: [PATCH] OCRmyPDF.sh: fixes issue for files having spaces fixes #31 --- OCRmyPDF.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/OCRmyPDF.sh b/OCRmyPDF.sh index 59c124aa..0d0248e0 100644 --- a/OCRmyPDF.sh +++ b/OCRmyPDF.sh @@ -154,7 +154,6 @@ fld=$(basename "$FILE_INPUT_PDF" | sed 's/[.][^.]*//') TMP_FLD="./tmp/$today.filename.$fld" FILE_TMP="$TMP_FLD/tmp.txt" # temporary file with a very short lifetime (may be used for several things) FILE_SIZE_PAGES="$TMP_FLD/page-sizes.txt" # size in pt of the respective page of the input PDF file -FILES_OCRed_PDFS="${TMP_FLD}/*-ocred.pdf" # string matching all 1 page PDF files that need to be merged FILE_OUTPUT_PDF_CAT="${TMP_FLD}/ocred.pdf" # concatenated OCRed PDF files FILE_OUTPUT_PDFA_WO_META="${TMP_FLD}/ocred-pdfa-wo-metadata.pdf" # PDFA file before appending metadata FILE_VALIDATION_LOG="${TMP_FLD}/pdf_validation.log" # log file containing the results of the validation of the PDF/A file @@ -303,8 +302,8 @@ done < "$FILE_SIZE_PAGES" # concatenate all pages [ $VERBOSITY -ge $LOG_DEBUG ] && echo "Output file: Concatenating all pages" -! pdftk $FILES_OCRed_PDFS cat output "$FILE_OUTPUT_PDF_CAT" \ - && echo "Could not concatenate individual PDF pages (\"$FILES_OCRed_PDFS\") to one file. Exiting..." >&2 && exit $EXIT_OTHER_ERROR +! pdftk "${TMP_FLD}/"*-ocred.pdf cat output "$FILE_OUTPUT_PDF_CAT" \ + && echo "Could not concatenate individual PDF pages (\"${TMP_FLD}/*-ocred.pdf\") to one file. Exiting..." >&2 && exit $EXIT_OTHER_ERROR # convert the pdf file to match PDF/A format [ $VERBOSITY -ge $LOG_DEBUG ] && echo "Output file: Converting to PDF/A"