Vanessa 2025-10-19 16:14:54 +08:00
parent bda1ec9e03
commit 4aa2b6bdc9
2 changed files with 19 additions and 1 deletions

View file

@ -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 /// #endif
] ]
}).element; }).element;

View file

@ -245,6 +245,7 @@ interface Window {
readHTMLClipboard(): string readHTMLClipboard(): string
getBlockURL(): string getBlockURL(): string
hideKeyboard(): void hideKeyboard(): void
exportPDF(html: string): void
}; };
JSHarmony: { JSHarmony: {
openExternal(url: string): void openExternal(url: string): void