# HG changeset patch # User Bernhard Reiter # Date 1549636216 -3600 # Node ID 40f26fbc505fa62803c92424329074ba10bf90cd # Parent 69c49301d689b4ef7f1d60f8a17a2471b09abca7 client: pdf-gen: add reference_water_level to details * If we have a reference_water_level, we display it for the selected bottleneck and survey. diff -r 69c49301d689 -r 40f26fbc505f client/src/components/Pdftool.vue --- a/client/src/components/Pdftool.vue Fri Feb 08 14:56:29 2019 +0100 +++ b/client/src/components/Pdftool.vue Fri Feb 08 15:30:16 2019 +0100 @@ -272,8 +272,8 @@ self.addAboutBox(pdf, width, height); if (self.getLayerByName("Bottleneck isolines").isVisible) { - self.addBottleneckInfo(pdf, 13, width, height); - self.addLegend(pdf, 14, width, height); + self.addBottleneckInfo(pdf, 15.5, width, height); + self.addLegend(pdf, 16.5, width, height); } pdf.save("map.pdf"); @@ -500,12 +500,14 @@ str = this.selectedBottleneck; this.addText(doc, docWidth - 51 + w, 4, 8, "black", 46, str); + let survey = this.selectedSurvey; + doc.setFontStyle("italic"); name = this.$gettext("Survey date") + ": "; w = doc.getTextWidth(name); this.addText(doc, docWidth - 51, 7.5, 8, "black", 46, name); doc.setFontStyle("normal"); - str = this.selectedSurvey.date_info; + str = survey.date_info; this.addText(doc, docWidth - 51 + w, 7.5, 8, "black", 46, str); doc.setFontStyle("italic"); @@ -513,8 +515,21 @@ w = doc.getTextWidth(name); this.addText(doc, docWidth - 51, 11, 8, "black", 46, name); doc.setFontStyle("normal"); - str = this.selectedSurvey.gauge_objname; + str = survey.gauge_objname; this.addText(doc, docWidth - 51 + w, 11, 8, "black", 46, str); + + doc.setFontStyle("italic"); + name = this.$gettext("Depth relativ to") + ": "; + w = doc.getTextWidth(name); + this.addText(doc, docWidth - 51, 14.5, 8, "black", 46, name); + doc.setFontStyle("normal"); + str = survey.depth_reference + " = "; + if (survey.hasOwnProperty("waterlevel_value")) { + str += survey.waterlevel_value + " cm"; + } else { + str += "?"; + } + this.addText(doc, docWidth - 51 + w, 14.5, 8, "black", 46, str); } } };