aboutsummaryrefslogtreecommitdiffstats
path: root/sdv/pdf/site/scripts/createfile.js
diff options
context:
space:
mode:
Diffstat (limited to 'sdv/pdf/site/scripts/createfile.js')
-rw-r--r--sdv/pdf/site/scripts/createfile.js13
1 files changed, 13 insertions, 0 deletions
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);
+}