# HG changeset patch # User Fadi Abbud # Date 1563447033 -7200 # Node ID c40f8b026de3004ff0c1973c0dbbf6f1890e82d3 # Parent ffc8227000568fa955daf9ea3b7b1df9e5355827 clinet: pdf-gen: fix positioning of text for template-textbox element diff -r ffc822700056 -r c40f8b026de3 client/src/lib/mixins.js --- a/client/src/lib/mixins.js Wed Jul 17 18:39:18 2019 +0200 +++ b/client/src/lib/mixins.js Thu Jul 18 12:50:33 2019 +0200 @@ -337,10 +337,7 @@ x = this.pdf.width - offset.x - width; } if (["bottomright", "bottomleft"].indexOf(position) !== -1) { - y = - this.pdf.height - - offset.y * 0.3 - - this.getTextHeight(textLines.length); + y = this.pdf.height - offset.y - this.getTextHeight(textLines.length); } this.pdf.doc.text(textLines, x, y, { baseline: "hanging" }); }, @@ -468,14 +465,25 @@ background, brcolor ); - this.addText( - position, - { x: offset.x + padding, y: offset.y + padding * 2 }, - textWidth, - fontSize, - color, - text - ); + if (["bottomright", "bottomleft"].indexOf(position) !== -1) { + this.addText( + position, + { x: offset.x + padding, y: offset.y - padding / 2 }, + textWidth, + fontSize, + color, + text + ); + } else { + this.addText( + position, + { x: offset.x + padding, y: offset.y + padding * 2 }, + textWidth, + fontSize, + color, + text + ); + } } } };