Skip to content

Instantly share code, notes, and snippets.

View sathyaprakash94's full-sized avatar
🏠
Working from home

WebTechie94 sathyaprakash94

🏠
Working from home
View GitHub Profile
@sathyaprakash94
sathyaprakash94 / savetoDoc.js
Created January 3, 2020 05:04 — forked from dcondrey/savetoDoc.js
Export an HTML element to Microsoft Word with CSS styles to set page orientation and paper size.
/* HTML to Microsoft Word Export
* This code demonstrates how to export an html element to Microsoft Word
* with CSS styles to set page orientation and paper size.
* Tested with Word 2010, 2013 and FireFox, Chrome, Opera, IE10-11
* Fails in legacy browsers (IE<10) that lack window.Blob object
*/
function saveDoc() {
if (!window.Blob) {
alert('Your legacy browser does not support this action.');