From 4aa2b6bdc9d85a850e64d843367ae86592e86b4f Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 19 Oct 2025 16:14:54 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/16152 --- app/src/menus/commonMenuItem.ts | 19 ++++++++++++++++++- app/src/types/index.d.ts | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/src/menus/commonMenuItem.ts b/app/src/menus/commonMenuItem.ts index 7b62ba24b..d0ee7c469 100644 --- a/app/src/menus/commonMenuItem.ts +++ b/app/src/menus/commonMenuItem.ts @@ -752,7 +752,24 @@ export const exportMd = (id: string) => { } }, ] - } + }, + /// #else + { + id: "exportPDF", + label: "PDF", + icon: "iconPDF", + ignore: !isInAndroid(), + click: () => { + const localData = window.siyuan.storage[Constants.LOCAL_EXPORTPDF]; + fetchPost("/api/export/exportPreviewHTML", { + id: "${id}", + keepFold: localData.keepFold, + merge: localData.mergeSubdocs, + }, response => { + window.JSAndroid.exportPDF(response.data.content); + }); + } + }, /// #endif ] }).element; diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts index 7c3a927f3..136544917 100644 --- a/app/src/types/index.d.ts +++ b/app/src/types/index.d.ts @@ -245,6 +245,7 @@ interface Window { readHTMLClipboard(): string getBlockURL(): string hideKeyboard(): void + exportPDF(html: string): void }; JSHarmony: { openExternal(url: string): void