PDFTK Rotating Pages Problem
When you use the "normal" rotation parameters (N, E, S, W), you are setting the rotation flag on the PDF pages to your parameter (e.g. 90 degrees). This does not take into account the current rotation setting. Here is the paragraph from the pdftk documentation about rotation:
The page rotation setting can cause pdftk to rotate pages and documents. Each option sets the page rotation as follows (in degrees): N: 0, E: 90, S: 180, W: 270, L: -90, R: +90, D: +180. L, R, and D make relative adjustments to a page's rotation.
In addition to the NESW rotation settings, you also have the L, R and D options, that allow you to make relative adjustments that take the current rotation flag into account.
If that does not solve your problem, I would need access to a couple of test documents (one that does work correctly, and one that results in the wrong rotation setting).
To rotate page 1 by 90 degrees clockwise:
pdftk in.pdf cat 1E output out.pdf # old pdftk
pdftk in.pdf cat 1east output out.pdf # new pdftk
To rotate all pages clockwise:
pdftk in.pdf cat 1-endE output out.pdf # old pdftk
pdftk in.pdf cat 1-endeast output out.pdf # new pdftk
Similarly, to rotate all pages anti-clockwise:
pdftk in.pdf cat 1-endwest output out.pdf