From cc01417a9983111fed775d80edef53e07f25aa9d Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 24 Jun 2022 13:27:39 -0300 Subject: fix #7090 dowload personal info as PDF --- .../src/pages/home/AttributeEntryScreen.tsx | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'packages/anastasis-webui/src/pages') diff --git a/packages/anastasis-webui/src/pages/home/AttributeEntryScreen.tsx b/packages/anastasis-webui/src/pages/home/AttributeEntryScreen.tsx index ed46aa095..228186a2d 100644 --- a/packages/anastasis-webui/src/pages/home/AttributeEntryScreen.tsx +++ b/packages/anastasis-webui/src/pages/home/AttributeEntryScreen.tsx @@ -94,6 +94,25 @@ export function AttributeEntryScreen(): VNode { }); }; + function saveAsPDF(): void { + const printWindow = window.open("", "", "height=400,width=800"); + const divContents = document.getElementById("printThis"); + const styleContents = document.getElementById("style-id"); + + if (!printWindow || !divContents || !styleContents) return; + printWindow.document.write( + "Anastasis Recovery Document "); + printWindow.document.close(); + printWindow.document.body.appendChild(divContents.cloneNode(true)); + printWindow.addEventListener("load", () => { + printWindow.print(); + printWindow.close(); + }); + } + return ( + Save the personal information as PDF +

- ) : null} + ) : undefined}
-
{fieldList}
+
+ {fieldList} +

This personal information will help to locate your secret.

This stays private

-- cgit v1.2.3