tpnguyen
asked on
printing a postscript file to a printer from within MFC application
Assume I already had a postscript file, now I need to print it to a printer from my MFC application. How can I do it? Normally I do this on UNIX:
sprintf(printstr, "lpr %s %s", filename, printer);
system(printstr);
I have tried the below on NT 4.0, however, the DOS box always shows up, and I did not want that.
sprintf(printstr, "copy %s %s", filename, printer);
system(printstr);
Thank you,
sprintf(printstr, "lpr %s %s", filename, printer);
system(printstr);
I have tried the below on NT 4.0, however, the DOS box always shows up, and I did not want that.
sprintf(printstr, "copy %s %s", filename, printer);
system(printstr);
Thank you,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
One other thing - if you have installed an application which is already registered as the default application for handling PS files (you can see it when the explorer refers to them as 'PostScript File' rather than 'PS-File'), it might be easier to use
ShellExecute ( NULL, "print", "<path to file>.ps", NULL, NULL, SW_HIDE);
ShellExecute ( NULL, "print", "<path to file>.ps", NULL, NULL, SW_HIDE);
ASKER
-Thang