Files
docx-js/docs/examples.md

60 lines
1.6 KiB
Markdown
Raw Normal View History

2018-08-04 03:40:41 +01:00
# Examples
2018-08-05 04:24:04 +01:00
> All examples can run independently and can be found in the `/demo` folder of the project
2018-08-05 04:14:25 +01:00
## Simple
2018-08-05 03:28:51 +01:00
A simple hello world of the `docx` library:
2018-08-05 04:18:12 +01:00
[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo1.js ':include')
2018-08-05 03:28:51 +01:00
2018-08-05 04:14:25 +01:00
*Source: https://github.com/dolanmiu/docx/blob/master/demo/demo1.js*
## Styles
This example shows how to customise the look and feel of a document using JS configuration
2018-08-05 04:18:12 +01:00
[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo2.js ':include')
2018-08-05 04:14:25 +01:00
2018-08-05 04:24:04 +01:00
*Source: https://github.com/dolanmiu/docx/blob/master/demo/demo2.js*
2018-08-05 04:14:25 +01:00
2018-08-05 04:18:12 +01:00
## Numbering
2018-08-05 04:14:25 +01:00
2018-08-05 04:18:12 +01:00
This example shows many levels of numbering
2018-08-05 04:14:25 +01:00
2018-08-05 04:18:12 +01:00
[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo3.js ':include')
2018-08-05 04:14:25 +01:00
2018-08-05 04:24:04 +01:00
*Source: https://github.com/dolanmiu/docx/blob/master/demo/demo3.js*
2018-08-05 04:14:25 +01:00
## Table
Example of simple table
2018-08-05 04:18:12 +01:00
[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo4.js ':include')
2018-08-05 04:14:25 +01:00
2018-08-05 04:24:04 +01:00
*Source: https://github.com/dolanmiu/docx/blob/master/demo/demo4.js*
## Images
Importing Images from file system path
[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo5.js ':include')
*Source: https://github.com/dolanmiu/docx/blob/master/demo/demo5.js*
## Margins
Example showing how to set custom margains
[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo6.js ':include')
*Source: https://github.com/dolanmiu/docx/blob/master/demo/demo6.js*
## Orientation
Example showing how to set the document to `landscape` or `portrait`
[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo7.js ':include')
*Source: https://github.com/dolanmiu/docx/blob/master/demo/demo7.js*