From caa9c3f705730886cab911cb241703a10494581c Mon Sep 17 00:00:00 2001 From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> Date: Tue, 30 Jul 2024 21:28:24 +0530 Subject: Added plot map details on top of pdf page. --- .../sheet-map/download-map-pdf-page-content.html | 20 ++++++++++++++++++++ src/scripts/functionality/sheet-map/index.ts | 10 ++++++++++ 2 files changed, 30 insertions(+) (limited to 'src/scripts/functionality/sheet-map') diff --git a/src/scripts/functionality/sheet-map/download-map-pdf-page-content.html b/src/scripts/functionality/sheet-map/download-map-pdf-page-content.html index 4d698ef..da765ec 100644 --- a/src/scripts/functionality/sheet-map/download-map-pdf-page-content.html +++ b/src/scripts/functionality/sheet-map/download-map-pdf-page-content.html @@ -25,7 +25,27 @@ stroke-linecap: round; stroke-linejoin: round; } + .details { + font-size: 1.3rem; + display: flex; + width: 100%; + padding: 0 1rem 1rem 1rem; + border-bottom: 2px solid black; + justify-content: space-around; + margin-bottom: 0.2rem; + } +
+
+ DISTRICT: $district$ +
+
+ BLOCK: $block$ +
+
+ MOUZA: $mouza$ +
+
$mapContent$ diff --git a/src/scripts/functionality/sheet-map/index.ts b/src/scripts/functionality/sheet-map/index.ts index c3ad13f..71228fe 100644 --- a/src/scripts/functionality/sheet-map/index.ts +++ b/src/scripts/functionality/sheet-map/index.ts @@ -44,8 +44,18 @@ const setPlotInformation = (plotPolygon: PlotPolygon | null | undefined = null) }; const downloadPDF = (labelPoints: boolean = true) => { + const _getMapDetail = (i: number) => { + const detail = document.querySelector(`#headerTable > tbody > tr > td:nth-child(${i})`)! + .innerHTML + .split("[")[1] + .trim(); + return detail.substr(0, detail.length - 1); + }; generateWebPage( getDownloadMapPDFPageContent({ + district: _getMapDetail(1), + block: _getMapDetail(2), + mouza: _getMapDetail(3), mapContent: plotPolygonPathElements + (labelPoints ? plotNumberLabelTextElements : "") }), "map" -- cgit v1.2.3