Skip to content

Commit

Permalink
fixed issue #29 - filenames with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
vsimko committed Mar 4, 2017
1 parent 5fb34b7 commit fbee510
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions share/figconv-plugins/pdf-output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function check_pdf() {

}

# Removes redundant borders from PDF files.
# Removes redundant borders from PDF files using pdfcrop.
# Parameters:
# $1 = PDF filename
function crop_pdf_file() {
Expand All @@ -46,7 +46,7 @@ function crop_pdf_file() {
if [ "$NUMPAGES" -gt 1 ]; then
# There are 2 or more pages, we need to split the PDF
echo -n "Splitting PDF containing $NUMPAGES pages into separate files ... "
pdfseparate "$1" ${1%.pdf}%d.pdf
pdfseparate "$1" "${1%.pdf}%d.pdf"
echo "done"

# The original multi-page PDF file will not be cropped
Expand All @@ -59,7 +59,7 @@ function crop_pdf_file() {
fi

# now cropping PDF files from the given list
for FILENAME in $LIST; do
find "$(dirname "$LIST")" -name "$(basename "$LIST")" | while read FILENAME; do
echo -n "Cropping PDF: $FILENAME ... "
pdfcrop "$FILENAME" "$TMPFILE" &> /dev/null

Expand Down

0 comments on commit fbee510

Please sign in to comment.