jeltsch's blog

Piping the output of find into a new command (find, xargs)

E.g. to change the permissions of all directories:

find . -type d -print | xargs /bin/chmod ug+rx

To be able to handle directory names with special characters

find . -type d -print0 | xargs -0 /bin/chmod ug+rx

In order to find all tif files in the current directory or below and to compress them (using the ImageMagick "mogrify" command and LZW compression):

find . -name '*.tif' -print | xargs mogrify -compress LZW

ps2pdf versus pstill and password protection of pdf documents

While reading about ps2pdf (which is just a commandline front-end to ghostscript), I realized that despite its simple appearance, ps2pdf has almost all capabilities of Acrobat 5. ps2pdf14 outputs Acrobat 5-compatible files. According to the documentation strong password protection should be possible, however, I never managed with that.

In theory the following commands should work:

-sOwnerPassword= and -sUserPassword=

In order to set the key length to 128 you have to use
ps2pdf14 -dEncryptionR=3 -dKeylength=128

Pages