Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the best way to programmatically output a file in the format of a Word document in Ruby?

I need to output a file in the format of a Word document from a Ruby-based web app (Rails/Sinatra) based on some textual content in the app. Is there library support in Ruby for creating and structuring a Word document?

like image 246
Yen Avatar asked Feb 28 '23 19:02

Yen


1 Answers

Take a look at WordML, the XML format for Word files.

John Durant's blog has a useful list of WordML and FAQ resources

Walkthrough: Word 2007 XML Format

Useful tool for creating XSLT transforms: Office 2003 Tool: WordprocessingML Transform Inference Tool

These SO posts might also be of interest:

  • Creating Word or XML document with VBA
  • Generating WordML Reports Using Templates and XPath using ASP.Net
  • Convert XHTML to Word ML
  • XML to WordML using XSLT 1.0 - replace html tags within xml content with wordML formatting tags
  • How can I convert convert docx or wordml xml files to xsl-fo?
like image 152
Mitch Wheat Avatar answered Apr 29 '23 03:04

Mitch Wheat