To remove the password from the PDF files , we can use script like below.
Shell File Name : removePassWord.sh
File Location: ~/bin/removePassWord.sh
----------------------------------------------CONTENT START----------------------------------------------------------
# Usage removePassWord.sh
for f in $1/*.pdf
do
echo "Removing password for pdf file - $f"
pdftops -upw $2 "$f" "$f".ps
ps2pdf "$f".ps "$f"
rm -rf "$f".ps
done
Shell File Name : removePassWord.sh
File Location: ~/bin/removePassWord.sh
----------------------------------------------CONTENT START----------------------------------------------------------
# Usage removePassWord.sh
for f in $1/*.pdf
do
echo "Removing password for pdf file - $f"
pdftops -upw $2 "$f" "$f".ps
ps2pdf "$f".ps "$f"
rm -rf "$f".ps
done
----------------------------------------------CONTENT ENDS ----------------------------------------------------------
No comments:
Post a Comment