printing problem with windows api



I have tried to print some lines through writeprinter method in
virtual printer (as a pdf file in cutepdf software). But this fails.
Although i am able to print with CDC. At some place i have read that
this is general problem with this function u have to use CDC.

Is there any solution to this problem?

Note: writeprinter method can print on actual printer but it fails
with virtual printer. Why??
.