You may also be interested in: fpweb.net
Editor's note: Contributor Usama Wahab Khan is a Senior Solution Architect for SharePoint and Microsoft Technologies. Follow him @usamawahabkhan
Word Automation Services was provided by Microsoft in SharePoint 2010 and Office 2010 to automate MSWord base bulk file operations on servers. Operations which include converting documents from two different formats like pdf, doc, and docx. And updating table of contents as well as importing alternate format chunks.
The word automation service helps developers to meet their business requirements for server side automation of Microsoft Word. In the past, developers were used to open XML Object Model to perform these kinds of tasks which was actually quite good but not highly scalable.
The Word Automation Service is highly optimized to perform huge service side operations to provide significantly greater performance for solutions. In SharePoint 2013 Microsoft improves a lot in Word Automation Services. Some major improvements include the following.
Word Automation Services 2013 architecture:
On demand file operations
In SharePoint 2013, developers can now create on demand file operations on the server by using Word Automation Services. In Order to create on demand file operations in SharePoint 2013 you have to send a request to Word Automation Services. These are based on the traditional Asynchronous Timer Job-based requests. They are not based on SharePoint timer jobs.
You can make on demand file conversion requests for only one file at a time. Word Automation Services in Microsoft SharePoint 2013 has the added option to create a file conversion request that’s processed as soon as you submit it and the conversion is started immediately and does not depend on the SharePoint Timer Job.
Word Automation Services now support streams in SharePoint 2013. In Previous versions of SharePoint 2010, Word Automation Services could convert only those files that were stored in SharePoint libraries. Now, using Stream, developers can store files outside of SharePoint.
// ConversionJob 2010
ConversionJob pdfJob = new ConversionJob("W A S");
pdfJob.UserToken = myWebsite.CurrentUser.UserToken;
pdfJob.AddFile(outputFilename, outputFilename.Replace(".docx", ".pdf"));
//Will Start after Provking start Funcation
//On demand file operation
SyncConverter syncConv = new SyncConverter("W A S");
syncConv.Settings.OutputFormat = SaveFormat.PDF;
ConversionItemInfo convInfo = syncConv.Convert(inStream, outStream);