Skip to content

Commit 8d9fb43

Browse files
committed
prints nolonger have more lines than the format
1 parent 7e51b4b commit 8d9fb43

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

signaturenDruck/js/printRenderer.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ function createPage (formatInformation, printInformation) {
3737
data.removeIndent !== undefined ? div.className = 'innerBox noIndent' : div.className = 'innerBox'
3838
div.id = data.id + '_' + i
3939
if (formatInformation.lines > 1) {
40-
_.each(data.data.txt, (line, i) => {
40+
let lines = data.data.txt
41+
for (let j = 0; j < formatInformation.lines && j < lines.length; j++) {
4142
let p = document.createElement('p')
4243
p.className = 'line_' + (parseInt(i) + 1)
43-
line === '' ? p.appendChild(emptyLine) : p.innerHTML = line
44+
lines[j] === '' ? p.appendChild(emptyLine) : p.innerHTML = lines[j]
4445
div.appendChild(p)
45-
})
46+
}
4647
} else {
4748
let p = document.createElement('p')
4849
p.className = 'line_1'

0 commit comments

Comments
 (0)