Ask Dot for a list of supported output formats.  This is pretty fragile.