Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top