Removing empty pages from PDF files

I created a script to scan documents and remove empty pages from the final PDF.