Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
docxtemplater-image-module
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
npm
docxtemplater-image-module
Commits
333cddeb
Commit
333cddeb
authored
Nov 18, 2015
by
Edgar HIPP
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use <w:p> or <w:t> even when image is empty
parent
5d43fd3d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
coffee/index.coffee
+8
-3
No files found.
coffee/index.coffee
View file @
333cddeb
...
@@ -47,8 +47,15 @@ class ImageModule
...
@@ -47,8 +47,15 @@ class ImageModule
imgData
=
scopeManager
.
getValueFromScope
(
tag
)
imgData
=
scopeManager
.
getValueFromScope
(
tag
)
tagXml
=
@
manager
.
getInstance
(
'xmlTemplater'
).
tagXml
tagXml
=
@
manager
.
getInstance
(
'xmlTemplater'
).
tagXml
tagXmlParagraph
=
tagXml
.
substr
(
0
,
1
)
+
':p'
if
@
options
.
centered
==
false
outsideElement
=
tagXml
if
@
options
.
centered
==
true
outsideElement
=
tagXmlParagraph
startEnd
=
"<
#{
tagXml
}
></
#{
tagXml
}
>"
startEnd
=
"<
#{
tagXml
}
></
#{
tagXml
}
>"
if
imgData
==
'undefined'
then
return
@
replaceBy
(
startEnd
,
tagXml
)
if
!
imgData
?
or
imgData
==
'undefined'
then
return
@
replaceBy
(
startEnd
,
outsideElement
)
try
try
imgBuffer
=
@
getImageFromData
(
imgData
)
imgBuffer
=
@
getImageFromData
(
imgData
)
catch
e
catch
e
...
@@ -61,10 +68,8 @@ class ImageModule
...
@@ -61,10 +68,8 @@ class ImageModule
size
=
[
@
convertPixelsToEmus
(
sizePixel
[
0
]),
@
convertPixelsToEmus
(
sizePixel
[
1
])]
size
=
[
@
convertPixelsToEmus
(
sizePixel
[
0
]),
@
convertPixelsToEmus
(
sizePixel
[
1
])]
if
@
options
.
centered
==
false
if
@
options
.
centered
==
false
outsideElement
=
tagXml
newText
=
@
getImageXml
(
rId
,
size
)
newText
=
@
getImageXml
(
rId
,
size
)
if
@
options
.
centered
==
true
if
@
options
.
centered
==
true
outsideElement
=
tagXml
.
substr
(
0
,
1
)
+
':p'
newText
=
@
getImageXmlCentered
(
rId
,
size
)
newText
=
@
getImageXmlCentered
(
rId
,
size
)
@
replaceBy
(
newText
,
outsideElement
)
@
replaceBy
(
newText
,
outsideElement
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment