Menu

#2 Optimized Zero Padding

open
nobody
None
5
2007-12-28
2007-12-28
No

The lines of code that added zero padding according to the current page number

while [ "$x" -le "$nu_pages" ]; do

if [ "$x" -lt 10 ]; then
(crop code)
elif [ "$x" -lt 100 ]; then
(crop code)
elif [ "$x" -lt 1000 ]; then
(crop code)
elif [ "$x" -lt 10000 ]; then
(crop code)
fi
done

are replaced by a more elegant code

for x in `seq -f '%04g' 1 $nu_pages`; do
(crop code)
done

which paves the way to remove the 10000 pages limitation.

Discussion

  • Anonymous

    Anonymous - 2007-12-28

    Patch

     
  • Anonymous

    Anonymous - 2007-12-28

    Script with applied patch

     
  • Anonymous

    Anonymous - 2007-12-28

    Logged In: YES
    user_id=1538618
    Originator: YES

    File Added: pdfcrop

     

Log in to post a comment.

MongoDB Logo MongoDB