I want to be able to convert RichText HTML, output that I'll be able to get from an editor like TinyMCE or CKEditor and convert it to Docx and PDF with formatting intact. I tried to search up other methods but they use PHP, are online apps or desktop apps. I need to be able to convert it with JavaScript.
UPDATE Since I couldn't find any solution that purely uses JS to convert documents, I used Unoconv instead. This allows me to convert a wide array of file types into HTML or any other file type.
I've used this for PDF creation: http://parall.ax/products/jspdf.
I've never done DocX creation, but this looks promising and I'd give it a shot: http://blog.innovatejs.com/?p=184.
FYI the package mentioned by MikeNQ above is only for Webkit, whereas jsPDF is cross-browser.