Commit 38a1132e by Edgar HIPP

Update imagemodule for new module-api

parent 54016475
DocXTemplater=require('docxtemplater') XmlTemplater=require('docxtemplater').XmlTemplater
vm=require('vm') vm=require('vm')
JSZip=require('jszip') JSZip=require('jszip')
...@@ -18,7 +18,8 @@ module.exports= class DocxQrCode ...@@ -18,7 +18,8 @@ module.exports= class DocxQrCode
@qr.callback= () -> @qr.callback= () ->
_this.ready= true _this.ready= true
_this.result= @result _this.result= @result
testdoc= new _this.xmlTemplater.currentClass @result, testdoc= new XmlTemplater @result,
fileTypeConfig:_this.xmlTemplater.fileTypeConfig
tags:_this.xmlTemplater.tags tags:_this.xmlTemplater.tags
Tags:_this.xmlTemplater.Tags Tags:_this.xmlTemplater.Tags
parser:_this.xmlTemplater.parser parser:_this.xmlTemplater.parser
......
...@@ -63,6 +63,7 @@ module.exports= class ImgReplacer ...@@ -63,6 +63,7 @@ module.exports= class ImgReplacer
@qr[u].decode(@imageSetter) @qr[u].decode(@imageSetter)
catch e catch e
console.error e console.error e
console.error e.stack
@imageSetter(mockedQrCode) @imageSetter(mockedQrCode)
dat= png.decode(finished) dat= png.decode(finished)
else else
......
...@@ -44,7 +44,8 @@ class ImageModule ...@@ -44,7 +44,8 @@ class ImageModule
tag = templaterState.textInsideTag.substr(1) tag = templaterState.textInsideTag.substr(1)
tagValue = scopeManager.getValue(tag) tagValue = scopeManager.getValue(tag)
tagXml=@manager.getInstance('xmlTemplater').tagXml xmlTemplater = @manager.getInstance('xmlTemplater')
tagXml=xmlTemplater.fileTypeConfig.tagsXmlArray[0]
tagXmlParagraph = tagXml.substr(0,1)+':p' tagXmlParagraph = tagXml.substr(0,1)+':p'
if @options.centered==false if @options.centered==false
......
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