Mercurial > gemma
diff client/src/lib/mixins.js @ 3293:76f643d20f19
clinet: pdf-gen: (cleanup) remove some pdf-functions from pdftool
* delete some pdf-functions in pdftool, the reusable functions are defind in mixins.js
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Thu, 16 May 2019 14:35:48 +0200 |
parents | aac1ca73e92a |
children | db1dc197dc43 |
line wrap: on
line diff
--- a/client/src/lib/mixins.js Thu May 16 14:15:45 2019 +0200 +++ b/client/src/lib/mixins.js Thu May 16 14:35:48 2019 +0200 @@ -63,6 +63,7 @@ export const pdfgen = { methods: { + // add text at specific coordinates and determine how many wrolds in a single line addText(position, offset, width, fontSize, color, text) { text = this.replacePlaceholders(text); // split the incoming string to an array, each element is a string of @@ -108,6 +109,7 @@ addImage(url, format, position, offset, width, height) { let x = offset.x; let y = offset.y; + //roundup-intern.intevation.de/wamos/issue416 if (["topright", "bottomright"].indexOf(position) !== -1) { x = this.pdf.width - offset.x - width; } @@ -126,6 +128,7 @@ } this.pdf.doc.addImage(image, x, y, width, height); }, + // add text at specific coordinates with a background box addBox(position, offset, width, height, rounding, color, brcolor) { // x/y defaults to offset for topleft corner (normal x/y coordinates) let x = offset.x; @@ -170,8 +173,6 @@ this.pdf.doc.text(text, x, y, { baseline: "hanging" }); }, addRoundedBox(x, y, w, h, color, rounding, brcolor) { - // draws a rounded background box at (x,y) width x height - // using jsPDF units this.pdf.doc.setDrawColor(brcolor); this.pdf.doc.setFillColor(color); this.pdf.doc.roundedRect(x, y, w, h, rounding, rounding, "FD");