Accessing Printer Driver

Hi is their any way by which i can access Printer Driver .I need to simulate the condition "Print to a file " in code .
[126 byte] By [khangharotha] at [2007-11-15]