Press "Enter" to skip to content

[MS Word] A jQuery Plugin That Allows an HTML Page To Be Converted | googoose

Googose allows you to convert any HTML content page into a properly formatted Microsoft Word (.doc) file.

Googoose is a jquery plugin that allows converting an HTML page and/or downloading it to an MS Word document with an eye on performance.

javascript save word document, dynamically generate a ms word document using html & css, export html content as a docx file, html form to word document, convert word to html using jquery, export html to word with css

Benefits:

  • You now have the ability to view rich web content.
  • You can create Word documents programmatically without much work, using a third-party library, etc.
  • You can directly integrate this into sites using WYSIWYG editors (ex: WordPress). There is no need to install a plugin.

How to make use of it:

1. Load the required JavaScript libraries within the webpage.

<script src="/path/to/jquery.min.js"></script>
<script src="/path/to/FileSaver.js"></script>

2. Make certain the jQuery Googoose plugin is loaded after jQuery:

<script src="jquery.googoose.js"></script>

3. Add the CSS class ‘googoose’ to HTML content.

<div class="googoose">
  ..
</div>

4. Call the googoose function to save lots of your web page as an MS word on web page load.

$(document).googoose();

5. Full customization choices.

$(document).googoose({

  // default selector of html to wrap the Word doc in
  area: 'div.googoose',

  // used to manufacture headers and footers
  headerfooterid: 'googoose-hdrftrtbl',

  // CSS origins of the Word document
  margins: '1.0in',

  // zoom percentage when the Word document opens
  zoom: '75',

  // the file name to save as
  filename: 'Doc1_' + now + '.doc',

  // size of the Word document
  size: '8.5in 11.0in',

  // display mode to open the Word document in
  display: 'Print',

  //  the language on the page
  lang: 'en-US',

  // determines whether the page should be downloaded as a Word document or displayed as HTML
  download: true,

  // if used by the developer this jQuery selector will translate into a Word table of contents
  toc: 'div.googoose.toc',

  // f used by the developer at this jQuery selector will translate into a Microsoft Word page break
  pagebreak: 'div.googoose.break',

  // the content in this jQuery selector will be put in the Microsoft Word document header
  headerarea: 'div.googoose.header',

  // the content in this jQuery selector will be put in the document footer
  footerarea: 'div.googoose.footer',

  // used solely by the googoose internals
  headerid: 'googoose-header',

  // used solely by the googoose internals
  footerid: 'googoose-footer',

  // CSS margin for the header
  headermargin: '.5in',

  // CSS margin for the footer
  footermargin: '.5in',

  //  generally used in headers and Footers this whole display the current page number
  currentpage: 'span.googoose.currentpage',

  // generally displayed in headers and Footers this jQuery selector when put into the HTML content will display the number of total pages.
  totalpage: 'span.googoose.totalpage',

  // html boundary
  htmlboundary: '--',

  // called after the HTML has been rendered
  finishaction: GG.finish,

  // the root node
  initobj: document
});

jQuery Plugin To Save Webpage As MS Word Document, googoose Plugin/Github


See Demo And Download

Official Website(aadel112): Click Here

This superior jQuery/javascript plugin is developed by aadel112. For extra Advanced Usages, please go to the official website.

Be First to Comment

    Leave a Reply

    Your email address will not be published.