Bookleting a PDF with Landscape Pages

For reasons not relevant here, we had to make a booklet out of a PDF file that contained several wide tables that should print in landscape mode, but were tagged as portrait pages. As a further complication, the pdftops utility I normally use complained vociferously about nearly every page:

Syntax Warning: FoFiType1::parse a line has more than 255 characters, we don't support this

A bit of fiddling produced this recipe, with pdf2ps in place of the usual pdftops:

pdfcrop --margins "36 0 10 0" FileName.pdf 
pdftk FileName-crop.pdf rotate 41-46east output FileName-crop-rotate.pdf
pdf2ps -dLanguageLevel=3 -sPAPERSIZE=letter -dFIXEDMEDIA FileName-crop-rotate.pdf -f 1

The gymnastics in pdf2ps forces letter-size pages, no matter what the internal size specifies.

That was not particularly obvious, but hooray for pdftk…