using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Word.Server.Conversions;
using Microsoft.SharePoint; 
namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {                 
            using (SPSite spSite = new SPSite( "http://servername:4040/"))
            {  
           //Defines a collection of settings for all conversions within a single conversion job.    
                ConversionJobSettings jobSettings=new ConversionJobSettings();
                jobSettings.OutputFormat = SaveFormat.PDF;
           //Represents a collection of file conversions (of single files or entire libraries) that share a common set of conversion properties and are
logically tracked as a single unit.
                ConversionJob pdfConversion = new ConversionJob("Word Automation Services", jobSettings);
                // Set the credentials to use when running the conversion job.
                pdfConversion.UserToken = spSite.UserToken;
                pdfConversion.AddFile("http://servername:4040/Shared%20Documents/ExternalList.docx",
                    "http://servername:4040/Shared%20Documents/ExternalList.pdf");
                pdfConversion.Start();
            }
        }
    }
} 
