Update documentation and README

This commit is contained in:
Dolan
2018-08-04 04:03:08 +01:00
parent 08a3538d8e
commit 7d05d69707
6 changed files with 74 additions and 80 deletions

View File

@ -4,21 +4,21 @@
Creating Headers and footers is simple. Access the `Header` and `Footer` by doing so like this:
```ts
```js
doc.Header;
doc.Footer;
```
You can call the same methods as you would with a `File`:
```ts
```js
doc.Header.createParagraph("Header text");
doc.Footer.createParagraph("Footer text");
```
Even add images:
```ts
```js
doc.Header.createImage([PATH_TO_YOUR_IMAGE]);
doc.Footer.createImage([PATH_TO_YOUR_IMAGE]);
```
@ -31,7 +31,7 @@ Also all the supported section properties are implemented according to: http://o
### Example
```ts
```js
const header = this.document.createHeader();
const footer = this.document.createFooter();

View File

@ -6,7 +6,7 @@ Adding images is very simple
Simply call the `createImage` method:
```ts
```js
const image = doc.createImage([PATH_TO_YOUR_IMAGE]);
```
@ -32,7 +32,7 @@ In Word this is found in:
The `PictureRun` element support various options to define the positioning of the element in the document.
```ts
```js
interface DrawingOptions {
position?: PlacementPosition;
textWrapping?: TextWrapping;
@ -42,7 +42,7 @@ interface DrawingOptions {
can be passed when creating `PictureRun()` for example:
```ts
```js
const imageData = document.createImageData(filename, buffer, 903, 1149);
new docx.PictureRun(imageData, {
@ -68,7 +68,7 @@ When placement position is FLOATING then we can use two options:
for `drawingOptions.textWrapping` we can define various options. `textWrapping` has the following properties:
```ts
```js
interface TextWrapping {
textWrapStyle: TextWrapStyle;
wrapTextOption?: WrapTextOption;
@ -94,7 +94,7 @@ enum WrapTextOption {
When we want to position the image relative or absolute then we need to use option `drawingOptions.floating`:
```ts
```js
export interface Floating {
horizontalPosition: HorizontalPositionOptions;
verticalPosition: VerticalPositionOptions;