Is it possible to print a PDF file from using windows Spooler API. I tried with below code and it is not working...
int print_handle = 0;
OpenPrinter(pPrinterName, &print_handle, NULL);
if (print_handle == 0)
{
return 0;
}
docinfo1.pDocName = (LPTSTR)("My PDF");
docinfo1.pOutputFile = NULL;
docinfo1.pDatatype = (LPTSTR)("RAW");
temp = StartDocPrinter(print_handle, 1, &docinfo1);
temp = StartPagePrinter(print_handle);
temp = WritePrinter(print_handle, (LPBYTE)filebuff, filelen, &bytes_written);
EndPagePrinter(print_handle);
EndDocPrinter(print_handle);
WritePrinter function return SUCCESS and nothing got printed. Printing TXT and PRN file using this API is working.