I am using GhostPDL 9.10. Though my paper size of 8.5x13 is listed at http://ghostscript.com/doc/7.07/Use.htm#Known_paper_sizes as "flsa" the "-sPAPERSIZE=flsa" switch had no effect, the paper size remained Letter. The correct units for the
-g5100x7800 switch matched my -r600 (not 720); -g works.