Yes, I took that from PSOutputDev, it's a starting point.