# HG changeset patch # User Fadi Abbud # Date 1567773561 -7200 # Node ID e58affd956c535c414da2633cc17ee29e22e83cb # Parent 4d0a09ae0828285e9e54d14b336a33fecf58ad2a pdf-gen: adjust place of text for textbox element diff -r 4d0a09ae0828 -r e58affd956c5 client/src/lib/mixins.js --- a/client/src/lib/mixins.js Fri Sep 06 11:15:49 2019 +0200 +++ b/client/src/lib/mixins.js Fri Sep 06 14:39:21 2019 +0200 @@ -483,8 +483,8 @@ width = this.pdf.doc.getTextWidth(text) + 2 * padding; } let textWidth = width - 2 * padding; + let textLines = this.pdf.doc.splitTextToSize(text, textWidth); if (!height) { - let textLines = this.pdf.doc.splitTextToSize(text, textWidth); height = this.getTextHeight(textLines.length) + 2 * padding; } this.addBox( @@ -499,7 +499,7 @@ if (["bottomright", "bottomleft"].indexOf(position) !== -1) { this.addText( position, - { x: offset.x + padding, y: offset.y - padding / 2 }, + { x: offset.x + padding, y: offset.y }, textWidth, fontSize, color, @@ -508,7 +508,10 @@ } else { this.addText( position, - { x: offset.x + padding, y: offset.y + padding * 2 }, + { + x: offset.x + padding, + y: offset.y + height - this.getTextHeight(textLines.length) + }, textWidth, fontSize, color,