Scenarios of the Open XML SDK for JavaScript
Client-Side Open XML Applications that Run In-Browser
Return to the
Open XML SDK for JavaScript
Developer CenterYou can build client-side Open XML applications that run in the browser. This enables you to provide Open XML functionality to your users without requiring them to install an executable such as a .NET application. You might create an application to:
- Collect input from the user and build a custom Word document such as a legal document, a sales proposal, or a management report. Of course, one of the cool things about these types of JavaScript applications is that they are super-easy to demonstrate. You can find a number of Open XML SDK for JavaScript applications hosted here at EricWhite.com. This Open XML SDK for JavaScript document generation example shows one approach to building this variety of application.
- Collect selection criteria and build a custom Spreadsheet that enables you to provide interesting functionality that they can run locally using Excel.
- Build a PowerPoint Presentation dynamically so that sales folks have a presentation tailored exactly to their current sales prospects.
- Enable the user to upload a Spreadsheet that contains data that they want to submit to the server.
- Enable the user to submit a Word document for validation. You might enable them to check that it meets corporate policy with regards to recommended phrasing or disallowed words.
One interesting scenario is that there are a fair number of developer tools that we can build using the Open XML SDK for JavaScript. Some ideas are:
- Generate a number of random documents for testing purposes. These documents can contain optionally contain a large number of Open XML features, such as tables, headers, footers, comments, content controls, and etc.
- Query an Open XML document to see metrics on it, and to see the features that it uses. You can know whether it contains comments, foot notes, or RTL text. I anticipate that this utility will query and report on a few dozen features.
- Simplify a document, removing features such as RSID attributes, comments, content controls, and MC markup.
Plans are that over time, we’ll be writing and hosting these applications here on EricWhite.com.
Currently, it is fairly easy to build a web-application with Open XML functionality using server-side technologies, such as the Open XML SDK from within an ASP.NET application. However, if you can’t use the Open XML SDK and the .NET Framework, life becomes more difficult. Supplying Open XML functionality in the browser has several advantages.
- First, this approach will work regardless of the server-side technology that you are using. It doesn’t matter whether you are using Java, PHP, or Ruby (or of course C# / .NET). If you can serve up JavaScript, you can serve up Open XML functionality.
- Second, you can deliver this functionality without requiring your users to upload documents to your server. This frees up server resources, and in some situations, enables interesting scenarios where clients do not want to expose confidential information in their documents. You can assure them that their document will not leave their browser.
- You can deliver this functionality to a wide variety of platforms, including some tablets, Macs, Linux / Unix, and phones.
The Open XML SDK for JavaScript has been tested with IE 9, IE 10, Chrome 27.0, and FireFox 20.0.1. As time allows, we will test against earlier versions of browsers. To a certain extent, the Open XML SDK for JavaScript relies on modern JavaScript engines such as Chakra and Chrome V8.
Node.Js Server Applications
If you need to build server-side Open XML functionality, you can use Node.Js to implement the functionality, and then use interop to call Node.Js from Java, C++, or other server-side technologies.
It may be possible that the ability of Node.Js to take advantage of multiple cores may enable high-performance Open XML functionality. This is a research project for the future.
One key use for Node.Js is testing your Open XML code. After writing a few thousand lines of Open XML code in JavaScript, you will want to run that code over your library of test documents. You can structure your tests so that they are isolated from whether they run in the browser or run using Node, and then build a test harness to exercise your code with hundreds or thousands of test documents.
Touch-Enabled Windows-8 ‘Windows Store’ Applications
There is a lot of fun to be had with this scenario. Combining touch, HTML5, CSS3, and Open XML presents interesting opportunities for writing collaboration and document manipulation applications.
Apps for Office Clients
When you are writing a JavaScript app for Word, you have the capability of retrieving the Open XML markup for any range of the document, modify it as appropriate, and then set the contents of the range. Having the Open XML SDK for JavaScript enables a lot of interesting applications.
While it is possible to extend Office using VBA or VSTO in Windows 7 and Windows 8, with Windows RT, JavaScript is the only extensibility approach for the Office clients, so accessing Open XML using JavaScript becomes even more important.
Apps for SharePoint 2013
One of the easiest ways to extend SharePoint is to write JavaScript code. It sidesteps all the issues associated with installing code on the server. In some cases, it is difficult to install code on the server. In others, it is completely prohibited. So having the capability of writing Open XML applications in JavaScript makes it super-easy to add Open XML functionality to SharePoint.