The same thing can be used to customize image size.
```
opts.getSize = function (img, tagValue, tagName) {
if(tagName === 'logo')
return [100, 100];
return [300, 300];
};
```
Notice
======
For the imagereplacer to work, the image tag: `{%image}` needs to be in its own `<w:p>`, so that means that you have to put a new line after and before the tag.
Testing
=======
You can test that everything works fine using the command `mocha`. This will also create some docx files under the root directory that you can open to check if the generation was correct.
Building in the browser
=======================
You can build a release for the browser with the following commands
The same thing can be used to customize image size.
```
opts.getSize = function (img, tagValue, tagName) {
if(tagName === 'logo')
return [100, 100];
return [300, 300];
};
```
Notice
======
For the imagereplacer to work, the image tag: `{%image}` needs to be in its own `<w:p>`, so that means that you have to put a new line after and before the tag.
Testing
=======
You can test that everything works fine using the command `mocha`. This will also create some docx files under the root directory that you can open to check if the generation was correct.
Building in the browser
=======================
You can build a release for the browser with the following commands
```
npm install
npm run preversion
npm run compile
```
You will have build/imagemodule.js.
If you still wish to use this outdated module which might have unsolved bugs, please have a look at the [OLD README](OLD_README.md)