Is it possible to create a .doc format file in JavaScript?
Currently I have a Mozilla addon which creates .txt files but curious to see if it could be extended to .doc ..
file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(fullPathToFile);
if (file.exists() === false)
{file.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 420);}
var outputStream = Components.classes["@mozilla.org/network/file-output-stream;1"]
.createInstance(Components.interfaces.nsIFileOutputStream),
converter = Components.classes["@mozilla.org/intl/converter-output-stream;1"]
.createInstance(Components.interfaces.nsIConverterOutputStream);
outputStream.init(file, 0x02 | 0x08 | 0x20, 420, 0);
converter.init(outputStream, "UTF-8", 0, 0);
converter.writeString('\n --------------------------------------------------- \n');
converter.close();
.doc
, instead of.rtf
workaround