Skip to content
/ toDoc Public

JavaScript library to create create a Word document with Text/HTML

License

Notifications You must be signed in to change notification settings

abs1337/toDoc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

86e7831 · Oct 25, 2019

History

13 Commits
Oct 23, 2019
Oct 24, 2019
Oct 25, 2019

Repository files navigation

toDoc

JavaScript library to convert HTML/Text to a Word Documnet

toDoc.createSection(sectionType, contentType, content, alignment, position, nextLine)

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

toDoc.createContent(type, content, position, nextLine)

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

toDoc.createDocument(fileName, params)

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

About

JavaScript library to create create a Word document with Text/HTML

Resources

License

Stars

Watchers

Forks

Packages

No packages published