# HG changeset patch # User Markus Kottlaender # Date 1549877916 -3600 # Node ID 318da99d406aaab330d6881221b5c5ac22203b6b # Parent 74c7d84f93d7dac55024a5dc036392dee1199f13 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... diff -r 74c7d84f93d7 -r 318da99d406a client/src/components/Pdftool.vue --- 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) {