I am trying to get pdf file from a word/doc/rtf file programmatically (C# or Command line). I am able to successfully print a word/rtf/doc file using print command in wordpad from command line: "write.exe /pt TextFileName PrinterName [ DriverName [ PortName ] ]"
. I have also found a utility to convert a ps file to pdf. But how do I get the ps format after the print command. And how to set a virtual printer to get a ps file?
Or is there any other way?
Install any PS print driver. Set the printer's port to FILE:
. Now when you print to that printer you'll be prompted for an output file name and the Postscript will be written to that file. If you want something more sophisticated, you can use RedMon or develop your own port monitor. See this answer.