Solution 1:

Do you mean skewed—as in, stretched in some way, like this:

parallelogram

—or rotated?

I'm assuming you mean rotated, since I honestly don't think it's possible for your scanner to mess the image up that badly!

If you just need to rotate, I would recommend PDF-Shuffler, a GUI-based program that can make the process of going through each page and rotating them as necessary a lot less painful. Have a look. And I'm sure there are other programs that could do the same thing.

Unfortunately, I don't know of any software that can look over all the pages in your PDF and decide for you which ones need to be transformed in some complex way, let alone rotated.

EDIT: If your file was a native pdf that could be converted into postscript (.ps) format, I think it's possible there is a way to autorotate pages using ghostscript. However, to my knowledge, you can't do this with scanned pages, because the auto-rotate feature relies on interpretation of text direction, which can only come from a native pdf or ps document. I'm not completely sure...I will look into this a little more.