The getScreenshot() function of the API only works if the viewport is visible.
Depending on what you need, you could instead use the Make2D component and export several line drawings from Grasshopper (as DXF or as bitmaps if you use Squid). But if you need a rendered view, there is not other way at the moment.