Does anyone know how to change the Printer Orientation (to Landscape or Portrait) using API?

I am pretty sure that this question has been answered before, so I tried to search this site. But the search functionality is disabled by the administrator.