If you have Windows PC with MS Office installed that is very easy to do.
Here is sample code
If you don't have MS Office installed then you need a program that can print a .doc file. See this posting for more information on this https://groups.google.com/d/topic/pdfnet-sdk/ovStpU-HGYk/discussion
For PHP go to the link below and download one of the C/C++, PHP packages.
On Linux, there is no support for converting office documents on Linux using PDFNetC, but you can use PDFNet cloud API to do that. Here you can find more information regarding that.