Rotate PDF without quality loss with convert from shell (imagemagick)

convert -density 300 -rotate -90 source.pdf -quality 100 destination.pdf