Sunday, December 26, 2010

Merging and encrypting PDF with Ghostscript

Recently I needed to merge several PDF files into a single file and also encrypt it. So after some googling, here my recipe:

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOwnerPassword=password1 -sUserPassword=password2 -dKeyLength=128 -dEncryptionR=3 -sOutputFile=output.pdf input1.pdf input2.pdf input3.pdf


Wednesday, December 1, 2010

Other Utility Mill scipts

I have made several utility mill scripts in the past and since I am reminded of it again, I might as well post links to my other utilities. Hopefully, someone will find it useful:

srt_delay: subtitle timing delay adjustment

I suppose SRT file timing offset is a common problem, however I can't seems to find any simple good tool that works on both Linux and Windows. While most media player on PC should be able to adjust the delays, my TV set-top box could open SRT files but could not adjust timing delays in the subtitle which could be annoying.

So, I decided to roll up my sleeves and wrote the little utility python script in a few minutes. Besides, how difficult could a simple format like this http://en.wikipedia.org/wiki/SubRip?

You can download the script from pastie.org:
http://pastie.org/1339071
I've released it as free and public domain. Anyone can use it to do anything you like.

Anyway, for Windows folks, I have also made and online version by porting it to excellent python script hosting called Utility Mill.
Just go to http://utilitymill.com/utility/srt_delay and follow the instructions.