mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 00:50:13 +01:00
This commit is contained in:
parent
99331ce331
commit
f08ff330c7
4 changed files with 28 additions and 8 deletions
|
|
@ -65,6 +65,11 @@
|
||||||
top: -9px;
|
top: -9px;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
font-weight: normal;
|
||||||
|
|
||||||
|
& > div.protyle-attr--bookmark {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
& > div:not(.protyle-attr--refcount) {
|
& > div:not(.protyle-attr--refcount) {
|
||||||
margin: 0 4px;
|
margin: 0 4px;
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,13 @@ svg {
|
||||||
display: flex;
|
display: flex;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
font-weight: normal;
|
||||||
|
|
||||||
& > div {
|
& > div.protyle-attr--bookmark {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > div:not(.protyle-attr--refcount) {
|
||||||
margin: 0 4px;
|
margin: 0 4px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -54,8 +59,8 @@ svg {
|
||||||
svg {
|
svg {
|
||||||
height: 12px;
|
height: 12px;
|
||||||
width: 12px;
|
width: 12px;
|
||||||
margin-right: 2px;
|
margin: 2px 2px 0 0;
|
||||||
flex-shrink: 0;
|
float: left;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ const renderPDF = (id: string) => {
|
||||||
#action {
|
#action {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
background: var(--b3-theme-background-light);
|
background: var(--b3-theme-background-light);
|
||||||
padding: 16px;
|
padding: 12px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
@ -132,6 +132,10 @@ const renderPDF = (id: string) => {
|
||||||
max-width: none;
|
max-width: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.b3-switch {
|
||||||
|
margin-left: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
.exporting::-webkit-scrollbar {
|
.exporting::-webkit-scrollbar {
|
||||||
width: 0;
|
width: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
|
|
@ -151,8 +155,8 @@ const renderPDF = (id: string) => {
|
||||||
border-bottom: 1px solid var(--b3-theme-surface-lighter);
|
border-bottom: 1px solid var(--b3-theme-surface-lighter);
|
||||||
display: block;
|
display: block;
|
||||||
color: var(--b3-theme-on-surface);
|
color: var(--b3-theme-on-surface);
|
||||||
padding-bottom: 16px;
|
padding-bottom: 12px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
${setInlineStyle(false)}
|
${setInlineStyle(false)}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -432,6 +436,7 @@ const renderPDF = (id: string) => {
|
||||||
scale: parseFloat(actionElement.querySelector("#scale").value),
|
scale: parseFloat(actionElement.querySelector("#scale").value),
|
||||||
pageSize: actionElement.querySelector("#pageSize").value,
|
pageSize: actionElement.querySelector("#pageSize").value,
|
||||||
},
|
},
|
||||||
|
left: previewElement.style.paddingLeft,
|
||||||
keepFold: keepFoldElement.checked,
|
keepFold: keepFoldElement.checked,
|
||||||
mergeSubdocs: mergeSubdocsElement.checked,
|
mergeSubdocs: mergeSubdocsElement.checked,
|
||||||
removeAssets: actionElement.querySelector("#removeAssets").checked,
|
removeAssets: actionElement.querySelector("#removeAssets").checked,
|
||||||
|
|
@ -440,7 +445,7 @@ const renderPDF = (id: string) => {
|
||||||
})
|
})
|
||||||
actionElement.remove();
|
actionElement.remove();
|
||||||
previewElement.classList.add("exporting");
|
previewElement.classList.add("exporting");
|
||||||
previewElement.style.paddingTop = "0";
|
previewElement.style.paddingTop = "6px";
|
||||||
previewElement.style.paddingBottom = "0";
|
previewElement.style.paddingBottom = "0";
|
||||||
});
|
});
|
||||||
setPadding();
|
setPadding();
|
||||||
|
|
@ -454,7 +459,7 @@ const renderPDF = (id: string) => {
|
||||||
modal: true,
|
modal: true,
|
||||||
show: true,
|
show: true,
|
||||||
width: 1032,
|
width: 1032,
|
||||||
height: 618,
|
height: 638,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
frame: "darwin" === window.siyuan.config.system.os,
|
frame: "darwin" === window.siyuan.config.system.os,
|
||||||
icon: path.join(window.siyuan.config.system.appDir, "stage", "icon-large.png"),
|
icon: path.join(window.siyuan.config.system.appDir, "stage", "icon-large.png"),
|
||||||
|
|
|
||||||
|
|
@ -378,6 +378,11 @@ const initWindow = () => {
|
||||||
mergeSubdocs: ipcData.mergeSubdocs,
|
mergeSubdocs: ipcData.mergeSubdocs,
|
||||||
})));
|
})));
|
||||||
try {
|
try {
|
||||||
|
ipcData.pdfOptions.displayHeaderFooter = true;
|
||||||
|
ipcData.pdfOptions.headerTemplate = "<span></span>";
|
||||||
|
ipcData.pdfOptions.footerTemplate = `<div style="font-size: 12px;padding-left:${ipcData.left}">
|
||||||
|
<a style="color:#5f6368;" href="https://b3log.org/siyuan">${window.siyuan.languages.exportBySiYuan}</a>
|
||||||
|
</div>`
|
||||||
window.siyuan.printWin.webContents.printToPDF(ipcData.pdfOptions).then((pdfData) => {
|
window.siyuan.printWin.webContents.printToPDF(ipcData.pdfOptions).then((pdfData) => {
|
||||||
fetchPost("/api/export/exportHTML", {
|
fetchPost("/api/export/exportHTML", {
|
||||||
id: ipcData.rootId,
|
id: ipcData.rootId,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue