7 ms·
Open-source Libraries for Working with Open XML Documents (docx, xlsx, pptx)
- jameskilton 12y agoMicrosoft is making it really hard to continue to blatantly dislike them.
- sliverstorm 12y agoJust tell people you are certain they are "up to something", perhaps trying to gain our trust and catch us napping.
- smacktoward 12y agoThey are up to something, namely trying to become relevant again. When you rule the world, you can get away with all sorts of obnoxious things. When you don't, it's either play nice or go home.
- Mikeb85 12y agoI'm beginning to like some parts of Microsoft. Babylon.js and TypeScript are both pretty cool projects, and their work on Haskell, F# and the new .NET compiler is all very cool.
- higherpurpose 12y agoReally? I find it pretty easy, especially after all the "team play" revelations they've been having with NSA. http://www.theguardian.com/world/2013/jul/11/microsoft-nsa-collaboration-user-data http://www.theguardian.com/world/2013/jul/11/microsoft-nsa-c... http://techcrunch.com/2014/05/13/nsa-docs-detail-efforts-to-collect-data-from-microsofts-skype-skydrive-and-outlook-com/ http://techcrunch.com/2014/05/13/nsa-docs-detail-efforts-to-... Not to mention that pushing Metro to my desktop didn't exactly win them brownie points with me, nor did being essentially the biggest patent troll around by asserting 300 patents against an open source project, and then helping Oracle in the ruling that decided API's are copyrightable.
- yuhong 12y agoI wrote a wishlist for Satya sometimes ago on Hal Berenson's blog (I even suggested MS withdraw the OOXML standard while not changing the format itself): http://hal2020.com/2014/03/03/satya-shuffles-his-leadership/#comment-14856 http://hal2020.com/2014/03/03/satya-shuffles-his-leadership/...
- bachmeier 12y agoI agree, but not on the basis of this. "Note: for this first release, you must have some version of Visual Studio installed." Until that changes, it's just another product in the Microsoft ecosystem.
- cwyers 12y agoReally? Because you can fix that. You can distribute those fixes. You can submit those fixes for Microsoft to consider making an official part of the release. Or you could fork it, fix it, and relicense your fork under the GPL.
- hrktb 12y agoI understand the order of magnitude is different, but until now the huge work made on OpenOffice/LibreOffice was on the same principle as what your are saying: "if MS doesn't do it, we'll make it ourself". So, saying you can have it as great as you want as long as your are willing to commit to it isn't really informative. Also I might be tainted by the years and years of Microsoft screwing with Office, but I'd wait until there is at least one or two serious players validate this project as fully working at scale until I'd give them the full credits.
- pling 12y agoSpend some time with VSTO on the client and the OOXML SDK on the server and I assure you that you'll still want to kill yourself. I just spent three months doing this and it was akin to knawing your own limbs off. The Office VSTO API is poorly designed, a mishmash of shims that barely work and are impossible to debug. The documentation is awful and their support teams don't even know how to fix problems. It's also absolutely painful making something work on Office 2097, 2010 and 2013. Its bad news when after a week you start wrapping all entry points to stop managed exceptions crashing office. Open sourcing stuff doesn't make it magically entirely pain free nor does it make a quality product. This isn't a quality product and neither is the thing that generates the documents you will need to parse (and clean all the incongruous crap) from.
- toyg 12y agoI know it's just a typo, but I hope our children will never have to suffer "Office 2097"...
- pling 12y agoWell spotted. I'll leave it in for posterity :) However I expect our Surface 2095 will run Office 2097 and it'll still have VBA jammed in due to some legacy clients moaning that they can't run their financial app in it any more :)
- jameshart 12y agoIf it survives the VBA-pocalypse in 2030, that is, because it interprets dates with two digit years ending in '/30' - '/99' as referring to 1930-1999...
- pling 12y agoAh yes I'd forgotten about that. Good point!
- peterkelly 12y agoAnd the iOS 39 version of Office will still be ahead of the Surface version
- shmerl 12y agoNot really. There was no need in OOXML to begin with. Especially in the ISO mess that MS created. It was born in the old MS, which was heavily into standards hijacking and vendor lock in. So it remained the child of that idea. Current day MS is still strongly dominated by the lock-in mentality. So this change is welcome, but they have a really long way to go to repair all the damage they caused and gain some trust.
- bithush 12y agoThis is obviously great but I find it annoying the instructions ask your to Set-ExecutionPolicy Unrestricted in order to run the PowerShell script. That is just lazy.
- Someone1234 12y agoThe default is Restricted, so no scripts can run at all. So they need to tell the user to change it to something. Their choices are AllSigned (or RemoteSigned which is the same thing in this context) or Unrestricted. If they chose the AllSigned route and then sign it with a CA certificate (e.g. Microsoft's Code Signing cert) that would work, but if the user ever made even a one character change to the script the thing will break and it might be unclear as to WHY. Plus you have to be careful not to lose your signature when sending files via certain technologies. Alternatively they could teach the user how to set up a local CA, make a key pair set, and then install. But that too is going to break a lot as it needs to be re-signed each time the script is updated, and obviously inter-machine coding will be a PITA. It is fairly standard practice on non-server developer machines to set it to Unrestricted. It isn't really any more dangerous than for example BAT or VBS scripts which have no such default restrictions. You call it lazy, but the alternatives seem impractical and painful. There are scenarios where you want to enforce code signing, I just don't really feel like a developer machine is one of them.
- toyg 12y agoMS screwed up with PowerShell policies. Because the default is so restrictive, corporate sysadmins are worried about altering it to Unrestricted, and signing each script is just impractical, so in practice lots of customers will just refuse to enable it. This is like a Linux distribution shipped OpenSSH disabled by default, and if you enabled it, you'd have to sign every script you run or allow everyone to run (almost) as root. I'm not a fan of PS (coming from Python, PS syntax is just nuts), but it's the most useful tool in the Windows world to automate tasks and deployments of all sorts... or rather it would be, if the security model weren't so inane that few people dare touching it.
- 12y ago
- jezell 12y agoAs if reading the documents was the problem. This is just some basic wrappers around an XML reader. Hard part is not reading the documents, it's rendering them.
- aquark 12y agoThe actual docs for the sdk are at: http://msdn.microsoft.com/en-us/library/office/bb448854(v=office.15).aspx http://msdn.microsoft.com/en-us/library/office/bb448854(v=of... A link from the github page might be helpful!
- spira 12y agoThe content also looks to be open sourced on Github, too: https://github.com/OfficeDev/office-content https://github.com/OfficeDev/office-content
- FigBug 12y agoSo far this looks Windows only. I'm currently using LibXL (http://www.libxl.com/ http://www.libxl.com/) to generate Excel documents. Anybody know of any other cross platform alternatives?
- sheetjs 12y agoShameless plug: we are working on a javascript solution. XLSX/XLSM/XLSB reader/writer: https://github.com/SheetJS/js-xlsx https://github.com/SheetJS/js-xlsx XLS(BIFF8)/XML(2003-4) reader: https://github.com/SheetJS/js-xls https://github.com/SheetJS/js-xls In-browser reader demo: http://oss.sheetjs.com/ http://oss.sheetjs.com/ In-browser writer demo: http://tokuhirom.github.io/js-xlsx-demo/ http://tokuhirom.github.io/js-xlsx-demo/ -- Some other alternatives: Python xlrd https://github.com/python-excel/xlrd https://github.com/python-excel/xlrd , xlwt https://github.com/python-excel/xlwt https://github.com/python-excel/xlwt , XlsxWriter https://github.com/jmcnamara/XlsxWriter https://github.com/jmcnamara/XlsxWriter Java POI https://poi.apache.org/ https://poi.apache.org/
- kevingadd 12y agoI don't see any reason why it would be Windows only. All the code appears to be spec-compliant C# that doesn't use P/Invoke to call native modules or rely on C++/CLI. The only sticking point I see is the PowerShell script, and that's pretty trivial to replace since it's just a build script (you could use xbuild/msbuild, since mono supports that, or just use make)
- clxl 12y agohttps://github.com/OfficeDev/Open-XML-SDK/pull/3 https://github.com/OfficeDev/Open-XML-SDK/pull/3 suggests that there are issues with use in mono
- cschmidt 12y agoIn python, I've had great luck with XlsxWriter http://xlsxwriter.readthedocs.org/ http://xlsxwriter.readthedocs.org/
- darkstalker 12y ago
- shmerl 12y agoC# only?
- fleetfox 12y agoCan this be used with Mono?
- shmerl 12y agoNot sure. I guess it's useful as a reference implementation (if it conforms to the specification that is), but not beyond that. Actual editors and office suites which could potentially use the code aren't written in C#.
- kevingadd 12y agoThe repo doesn't contain any P/Invoke or C++/CLI, so I don't see any reason why it wouldn't work with Mono.
- wluu 12y agoThere's a pull request for a basic mono build file - https://github.com/OfficeDev/Open-XML-SDK/pull/3 https://github.com/OfficeDev/Open-XML-SDK/pull/3
- jameshart 12y agoNot really. It's written in C#; the result of compiling it will be a managed library - a .dll containing a .NET assembly of CIL code. You can then load it into a .NET runtime (looks like they're working to ensure it will run in Mono as well as the Microsoft CLR) and easily call the library from other managed code, which could be C#, VB.NET, F#, C++/CLI etc. Assuming it does get to the stage where it can be run on Mono, you could embed the Mono runtime (http://www.mono-project.com/Embedding_Mono http://www.mono-project.com/Embedding_Mono) and call it from any language with a C binding (you would have to write some C, e.g. by building a JNI wrapper for the mono runtime to expose the library to Java code - eugh). On Windows, you should be able to easily wrapper it and expose it via COM, if you wanted to use it from proper C++, or Delphi or FoxPro, perhaps. But what do you expect? Multi-language interop for libraries is hard, though. Frankly the fact that it's natively accessible from every CLR language is pretty impressive - most Python libraries can't really be used from anything but Python, for example. Generally the approach with an open source library like this would be for someone to take on porting it to, e.g., Java.
- holloway 12y agoAlternative is my Docvert http://github.com/holloway/docvert-python3 http://github.com/holloway/docvert-python3 software... it works on Linux/Windows/OSX though it's mostly for reading DOCX/DOC/ODT and not for writing.
- mirchiseth 12y agoReally no mention of docx4j http://www.docx4java.org/ http://www.docx4java.org/
- whitehat2k9 12y agoFor Python there's also PyExcelerate for creating XLSX files: https://github.com/kz26/PyExcelerate https://github.com/kz26/PyExcelerate Supposedly it's the fastest, even beating out xlsxwriter.
- fafner 12y agoMichael Meeks' (LibreOffice developer) response https://people.gnome.org/~michael/blog/2014-06-25-openxmlsdk.html https://people.gnome.org/~michael/blog/2014-06-25-openxmlsdk...
- jwildeboer 12y agoI wonder why they call it Open XML. I thought it was called Offie Open XML (OOXML) and it was standardized as ISO 29500. As it seems, this project does NOT implement the ISO standard, instead it works with the non-standard compliant versions that Microsoft Office produces. Le Sigh.