changeset 2222:318da99d406a pdf-export

PDF generation: fix text size calculation For jsPDF to correctly calculate the display size of text, it's important that all font properties are set before the calculation. Makes sense...
author Markus Kottlaender <markus@intevation.de>
date Mon, 11 Feb 2019 10:38:36 +0100
parents 74c7d84f93d7
children 85142493096c
files client/src/components/Pdftool.vue
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/Pdftool.vue	Mon Feb 11 10:26:03 2019 +0100
+++ b/client/src/components/Pdftool.vue	Mon Feb 11 10:38:36 2019 +0100
@@ -518,9 +518,9 @@
       }
 
       // split the incoming string to an array, each element is a string of words in a single line
-      var textLines = this.pdf.doc.splitTextToSize(text, width - 2 * padding);
       this.pdf.doc.setTextColor(color);
       this.pdf.doc.setFontSize(fontSize);
+      var textLines = this.pdf.doc.splitTextToSize(text, width - 2 * padding);
       this.pdf.doc.text(x + padding, y + padding, textLines);
     },
     addImage(url, format, position, offset, width, height, border) {