Skip to content

Instantly share code, notes, and snippets.

@AtsushiA
Created March 26, 2017 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AtsushiA/70ada6032b71007f7eceeb1b073ec8fb to your computer and use it in GitHub Desktop.
Save AtsushiA/70ada6032b71007f7eceeb1b073ec8fb to your computer and use it in GitHub Desktop.
#! /bin/bash
#set -ex
SOURCE_FILE=$1
FILE_NAME=`basename $1`
DISTNATION_FILE=`dirname $1`/${FILE_NAME%.*}_o.pdf
LANG=C
LC_ALL=C
## Check Value
if [ $# -ne 1 ]; then
echo -e "wrong value! \n Please Set ( Command [PDF Name] )"
exit 1
fi
## Check PDF File
if [ ${SOURCE_FILE: -4} != ".pdf" ]; then
echo "${SOURCE_FILE: -4}"
echo "Set File is wrong! Please set PDF File"
exit 2
fi
## Duplicate File
echo "test :${SOURCE_FILE: -4}"
echo "Source File : ${SOURCE_FILE}"
echo "Distnation File : ${DISTNATION_FILE}"
cp ${SOURCE_FILE} ${DISTNATION_FILE}
## Convert File
sed -i '' s'|/Registry (Adobe) /Ordering (Japan1) /Supplement [0-9]|/Registry(Adobe) /Ordering(Identity) /Supplement 0|g' ${DISTNATION_FILE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment