🎨 导出 PDF 时支持将资源文件作为附件嵌入 https://github.com/siyuan-note/siyuan/issues/7414

This commit is contained in:
Liang Ding 2023-02-23 10:50:08 +08:00
parent c0c605b664
commit f003aac384
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
6 changed files with 9 additions and 9 deletions

View file

@ -3,7 +3,7 @@ import {exportLayout, getInstanceById, JSONToLayout, resetLayout, resizeDrag, re
import {hotKey2Electron, setStorageVal, updateHotkeyTip} from "../protyle/util/compatibility";
/// #if !BROWSER
import {dialog, getCurrentWindow} from "@electron/remote";
import {webFrame, ipcRenderer, OpenDialogReturnValue} from "electron";
import {ipcRenderer, OpenDialogReturnValue, webFrame} from "electron";
import * as fs from "fs";
import * as path from "path";
import {afterExport} from "../protyle/export/util";
@ -418,7 +418,7 @@ export const initWindow = () => {
const pdfFilePath = path.join(result.filePaths[0], replaceLocalPath(ipcData.rootTitle) + ".pdf");
fs.writeFileSync(pdfFilePath, pdfData);
window.siyuan.printWin.destroy();
fetchPost("/api/export/addPDFOutline", {
fetchPost("/api/export/processPDF", {
id: ipcData.rootId,
merge: ipcData.mergeSubdocs,
path: pdfFilePath