using SubSystems.WP;     // set the namespace

   // Convert doc/docx file to pdf file
   void ConvertFile(string DocInputFile, string PdfOutputFile)
   {
     Wpn wp = new Wpn();      // Create the conversion object
     wp.InWebServer = true;   // set to true when hosting the

     // convert doc/docx to pdf
     wp.WpsConvertFile(DocInputFile, PdfOutputFile); 
   }


   // Convert a byte array containing doc/docx to pdf
   byte[] ConvertBuffer(byte[] DocInputBytes) 
   {
     Wpn wp = new Wpn();      // Create the conversion object
     wp.InWebServer = true;   // set to true when hosting the

     string PdfString = wp.WpsConvertBuffer(DocInputBytes);
     return wp.WpsStrToBytes(PdfString); // return pdf bytes
   }