JavaScript library to convert HTML/Text to a Word Documnet
Creates a Header or Footer Section in the document
Kind: static method of toDoc
Access: public
Param | Type | Description |
---|---|---|
sectionType | string |
Defines whether the section is a header or footer Accepts : "header", "footer" Required |
contentType | string |
Defines whether the section contains an image, text or HTML markup Accepts : "image", "text", "html" Required |
content | string |
Defines the sections's content Accepts : stringified image URLs, stringified text, stringified HTML markup Required |
alignment | string |
Defines the section content's alignemnt Accepts : "left", "center", "right" Required |
position | number |
Specifies the content's position in the section Accepts : 1++ Default value : 0 Optional |
nextLine | boolean |
Specifes whether the section's content should start in a new line Accepts : true, false Default value : false Optional |
Creates a Paragraph or Page in the document
Kind: static method of toDoc
Access: public
Param | Type | Description |
---|---|---|
type | string |
Specify whether the content is a Paragraph, a Page or an Image Accepts : "paragraph", "page", "image" Required |
content | string |
Defines the document's content Accepts : stringified text, stringified HTML markup, stringified image URLs Required |
position | number |
Defines the content's position in the document Accepts : 1++ Default value : 0 Required for pagagraphs, pages and images Optional if passing a whole HTML document |
nextLine | boolean |
Specifes whether the content should start in a new line Accepts : true, false Default value : false Optional |
Generates and saves a Word document.
Kind: static method of toDoc
Access: public
Param | Type | Description |
---|---|---|
fileName | string |
Specifies the name of the document Required |
params | object |
Define custom parameters for the document's layout Optional |