-
Printing to file
Hi.
I write a program, which must print data. My printer now is not working properly, but I should keep on working. So, to test my program I want to print to file, if it is possible.
Here is my code:
Code:
int res;
DOCINFO docInfo;
docInfo.lpszDocName="Some name";
docInfo.lpszOutput="print";
docInfo.cbSize=sizeof(DOCINFO);
docInfo.fwType=0;
docInfo.lpszDatatype="raw";
CDC *pDC;
if(SendDlgItemMessage(IDC_PRINT_CHECK,BM_GETCHECK,0,0)!=BST_CHECKED)
return;
pDC=InitializePrinting();
res=::StartDoc(pDC->m_hDC,&docInfo);
//pDC->StartDoc(_T("Some name"));
....
I thought that this line:
Code:
docInfo.lpszOutput="print";
should name the file where I'm printing instead of the printer.
But after that "printing" I didn't find such a file on my hard drive. :(
the call:
Code:
pDC=InitializePrinting();
returns valid CDC object and the ::StartDoc() returns positive number- so it must works. Any suggests?
And one more question: What is the format, in which the file is "printed" and how can I view it?