Basic Options

Capturing webpages as DOCX converts the entire web page into a Word document that can consist of many pages. Only one parameter is required in order to convert a web page into a Word document or to convert HTML to DOCX as shown in the below examples.

Custom Identifier

You can pass a custom identifier to the DOCX methods as shown below, this value is then returned to your GrabzIt Node.js handler. For instance this custom identifier could be a database identifier, allowing a DOCX document to be associated with a particular database record.

Headers and Footers

To add a header or footer to a Word document you can request that you want to apply a particular template to the DOCX being generated. This template must be saved in advance and will specify the contents of the header and footer along with any special variables. In the example code below the user is using a template they created called "my template".

Convert HTML element to DOCX

If you want to just convert a HTML element such as a div or span directly into a Word document you can with GrabzIt's Node.js library. You must pass the CSS selector of the HTML element you wish to convert to the setTargetElement parameter.