# HG changeset patch # User Fadi Abbud # Date 1569489697 -7200 # Node ID 004d0803831927339ea2c63e9ba626d2b8e88281 # Parent 2d2c9f98360a76f8f4367236bf86c4dabfd94a84 client: pdf-gen: add bottleneck info to default template and improve it * add legend and bottleneck to the default template * add more padding to bottleneck element for better layout diff -r 2d2c9f98360a -r 004d08038319 client/src/components/Pdftool.vue --- a/client/src/components/Pdftool.vue Wed Sep 25 16:58:38 2019 +0200 +++ b/client/src/components/Pdftool.vue Thu Sep 26 11:21:37 2019 +0200 @@ -153,13 +153,12 @@ { type: "scalebar", position: "bottomright", - offset: { x: 2, y: 2 } + offset: { x: 1, y: 1 } }, { type: "textbox", position: "bottomleft", - offset: { x: 2, y: 2 }, - width: 60, + offset: { x: 1, y: 1 }, fontSize: 8, text: this.$gettext("Generated by") + " " + "{user}, {date}" }, @@ -168,6 +167,16 @@ position: "topleft", offset: { x: 6, y: 4 }, size: 2 + }, + { + type: "bottleneck", + position: "topright", + offset: { x: 2, y: 2 } + }, + { + type: "legend", + position: "topright", + offset: { x: 2, y: 25 } } ] } @@ -749,39 +758,44 @@ // bottleneck this.pdf.doc.setFontStyle("italic"); - this.pdf.doc.text(x + padding, y + padding, str1_1, textOptions); + this.pdf.doc.text(x + padding, y + padding + 2, str1_1, textOptions); this.pdf.doc.setFontStyle("bold"); - this.pdf.doc.text(x + padding + w1_1, y + padding, str1_2, textOptions); + this.pdf.doc.text( + x + padding + w1_1, + y + padding + 2, + str1_2, + textOptions + ); // survey date this.pdf.doc.setFontStyle("italic"); - this.pdf.doc.text(x + padding, y + padding + 4, str2_1, textOptions); + this.pdf.doc.text(x + padding, y + padding + 6, str2_1, textOptions); this.pdf.doc.setFontStyle("normal"); this.pdf.doc.text( x + padding + w2_1, - y + padding + 4, + y + padding + 6, str2_2, textOptions ); // ref gauge this.pdf.doc.setFontStyle("italic"); - this.pdf.doc.text(x + padding, y + padding + 8, str3_1, textOptions); + this.pdf.doc.text(x + padding, y + padding + 10, str3_1, textOptions); this.pdf.doc.setFontStyle("normal"); this.pdf.doc.text( x + padding + w3_1, - y + padding + 8, + y + padding + 10, str3_2, textOptions ); // depth relative to this.pdf.doc.setFontStyle("italic"); - this.pdf.doc.text(x + padding, y + padding + 12, str4_1, textOptions); + this.pdf.doc.text(x + padding, y + padding + 14, str4_1, textOptions); this.pdf.doc.setFontStyle("normal"); this.pdf.doc.text( x + padding + w4_1, - y + padding + 12, + y + padding + 14, str4_2, textOptions );