From 86d4114ab61f9cb00c1d01f91e81e9a38c6ba2f6 Mon Sep 17 00:00:00 2001 From: opensource-tnbt Date: Thu, 10 Sep 2020 12:23:34 +0530 Subject: SDV: Platform Description Implementation. This patch includes PDF Template and a tool to create PDF. Signed-off-by: Sridhar K. N. Rao Change-Id: Ib702ff42352d584cb9146ff1959258c558e06615 --- sdv/pdf/site/scripts/createfile.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 sdv/pdf/site/scripts/createfile.js (limited to 'sdv/pdf/site/scripts/createfile.js') diff --git a/sdv/pdf/site/scripts/createfile.js b/sdv/pdf/site/scripts/createfile.js new file mode 100644 index 0000000..2e13f2f --- /dev/null +++ b/sdv/pdf/site/scripts/createfile.js @@ -0,0 +1,13 @@ +/** + * This function creates a Json file to support client-side file download + */ + +function createjson() { + element=document.getElementById('pdfform') + data = objectifyDiv(element); + jsonstr = JSON.stringify(data); + var data = new Blob([jsonstr], {type: 'application/json'}); + var url = window.URL.createObjectURL(data); + document.getElementById('download_link').href = url; + console.log(jsonstr); +} -- cgit 1.2.3-korg