I've managed to use the myexcel.js library file from jArchi, but is there an equivalent for creating a MS Word document (open office xml)?
Hi,
In fact you can use almost any javascript library designed for Node.js or browser.
A quick search returns several hits for https://docx.js.org. Ifyou look at this example (https://codepen.io/anon/pen/dqoVgQ?editors=1010), it seems that you can simply load the lib and tune a bit the saving process to use jArchi's one.
Regards,
JB
Thanks for the guidance. Super exciting - I grabbed the download and looked at the .js but when I try to load use it from jArchi, it doesn't like a few things. Firstly there were a lot of <CR>'s in there. Simple fix to find and replace. Now it doesn't like class definitions that it uses. For example:
class Bold extends xml_components_1.XmlComponent {
constructor() {
super("w:b");
this.root.push(new xml_components_1.Attributes({
val: true,
}));
}
}
exports.Bold = Bold;
I'm not much of a js expert, but I believe classes were introduced later in the standard. Anyone know of a way round this? I think it might be possible to recode the classes as functions?
Or maybe I look for an alternative library.