Introduction
Word Automation Service is a service provided by Microsoft in SharePoint 2013 to perform conversion of documents that are supported by Microsoft Word. The conversion that happens is purely server-side conversion. This service existed in SharePoint 2010 version as well. The main change in this service from SharePoint 2010 to SharePoint 2013 version is the implementation of requests for “on demand” file conversion.
Background
In SharePoint 2010, whenever the conversion request was sent to the server it was required to create a file conversion job and by using “Start” method, the conversion job would be started. Then the conversion would actually happen based on the interval set in the properties of the Word Automation service in Central Administration. The properties in the Automation Service can also be used to set how often the timer job needs to run and how sooner it needs to start with the minimum value being one minute.
Current Scenario
In SharePoint 2013, Microsoft has maintained the earlier 2010 feature and also added “on demand” conversion to easy the burden on the developers. This feature will enable the request to be executed as soon as the request is created. Think of “on demand” as a synchronized process wherein the job is executed without any delays. Whereas, the other way is an asynchronous process which waits for some amount of time specified in the properties.
In SharePoint 2010, it was possible to convert only those documents which were present in SharePoint library. In SharePoint 2013 the conversion job can also convert the documents present in the file system using file streams. Since the file stream uses Word Automation Service, it can convert only one document at a time.
Architecture
The above figure shows the architecture and the request processing method of the Word automation process from the server object model. The Word automation process maintains two queues for both kinds of processes. One queue for the “on demand” or immediate requests and the other is for SharePoint timer-job based requests. The document conversion request of “on demand” will always get prioritized over the timer-job based requests.
If the Word automation service is already working on the timer-job based request and it receives an “on demand” request then it will immediately stop the earlier conversion job and execute the “on demand” request first.
Configuration
- Open Central Administration and click on Manage Service Applications.
- In the service application list on the top ribbon click on “new” and click on “Word Automation Services”.
3. A modal dialog box will open up as show below:
4. Fill in the details as described below:
- Name – Name of the word Service example – TrigentAutomationService
- Application Pool Name – Preferably same as the name of the service example – TrigentAutomationService
- Select the security account that has been registered
- Partitioned Mode – No need to check this as there is no requirement of partition
- Add to Default Proxy List – check this – This will create word service in the proxy list
- Click on “Next”
5. On click of “Next” you will be asked to give the database server and the name of the database where the service resides. It is advisable to give the same server as the Sharepoint DB
6. Click on “Finish”. The Word Automation Service should get created successfully. It may take some time depending on the response of the system. It will be listed along with the other services as below:
Properties
Once the service is created successfully we need to modify the properties depending upon the requirement.
- Supported File Formats – This is used to specify what all file types can be opened by the service.
- Embedded Font Support – A user can choose to embed fonts within the document.
- Maximum Memory Usage – Maximum percentage of memory that can be used by the service from 1 to 100.
- Recycle Threshold – Number of documents converted by a conversion process before it is restarted.
- Word 97-2003 Document Scanning – Extra checks are performed before these documents are opened.
- Conversion Processes – The number of conversions that can be performed simultaneously.
- Conversion Throughput – The frequency with which groups of conversions are started in minutes.
- Job Monitoring – The length of time before conversions are monitored in minutes.
- Maximum Conversion Attempts – Maximum attempts before it is considered as failed
- Maximum Synchronous Conversion Requests – Maximum number of synchronous conversion requests that can be processed at a time for a server.
Business use cases
While Word Automation Service does the job of converting documents from one format to another it certainly does have multiple business uses such as –
- An application where in the users inputs certain information and that information gets saved in a SharePoint list or library. A background code can be written to gather the user input information and create a word document. This document in turn can be used by the word automation service to convert it from word to PDF so that the document could be shared offline. This application could be as simple as generating a ticket or as complex as generating health and safety plan for any construction companies. It can have multiple input screens and multiple lists as well.
- An application which allows the user to upload their word files with the relevant inputs and stored in a location. Word Automation Service can be used to convert these files into PDF or XPS format. It can be made to be downloaded by the user for printing or using it offline.
- An application where based on user inputs certain pre-selected documents should attached from a source outside of SharePoint. Word Automation Service can be used to select that document and convert it and made available to the user for download.