Is there any way to programmatically switch to/from RAW?

To programmatically change the data type for printers use the ResetPrinter() Windows API function. Pass "RAW" or "EMF 1.003" for the desired datatype as parameter. For more information about the ResetPrinter() function please see the MSDN documentation.