Commit 7af658c1 by MaxRcd

Updated readme

parent ed8ce5d4
Open source docxtemplater image module Open source docxtemplater image module
========================================== ==========================================
This repository holds a updated version of docxtemplater image module. This repository holds an updated version of docxtemplater image module.
This package is open source. There is also a [paid version](https://docxtemplater.com/modules/image/) maintained by docxtemplater author. This package is open source. There is also a [paid version](https://docxtemplater.com/modules/image/) maintained by docxtemplater author.
...@@ -8,7 +8,7 @@ Note this version is compatible with docxtemplater 3.x. ...@@ -8,7 +8,7 @@ Note this version is compatible with docxtemplater 3.x.
Installation Installation
============= =============
You first need to install docxtemplater by following its [installation guide](https://docxtemplater.readthedocs.io/en/latest/installation.html#node). You first need to install docxtemplater by following its [installation guide](https://docxtemplater.readthedocs.io/en/latest/installation.html).
For Node.js install this package For Node.js install this package
``` ```
...@@ -17,6 +17,13 @@ npm install open-docxtemplater-image-module ...@@ -17,6 +17,13 @@ npm install open-docxtemplater-image-module
For the browser find builds in `build/` directory. For the browser find builds in `build/` directory.
Alternatively, you can create your own build from the sources:
```
npm run compile
npm run browserify
npm run uglify
```
Usage Usage
===== =====
To render an image, your **docx** or **pptx** template should contain the text: `{%image}` To render an image, your **docx** or **pptx** template should contain the text: `{%image}`
...@@ -68,6 +75,11 @@ Some notes regarding the template: ...@@ -68,6 +75,11 @@ Some notes regarding the template:
Centering images Centering images
================ ================
You can center all images using either passing the option `opts.centered = true` or one by one using `{%%image}` instead of `{%image}` in your templates. You can center all images by setting the global switch to true `opts.centered = true`.
If you would like to choose which images should be centered one by one:
* Set the global switch to false `opts.centered = false`.
* Use `{%image}` for images that shouldn't be centered.
* Use `{%%image}` for images that you would like to see centered.
In **pptx** generated documents, images are centered vertically and horizontally relative to the parent cell. In **pptx** generated documents, images are centered vertically and horizontally relative to the parent cell.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment