This commit is contained in:
Vanessa 2022-12-11 22:28:54 +08:00
parent 99331ce331
commit f08ff330c7
4 changed files with 28 additions and 8 deletions

View file

@ -65,6 +65,11 @@
top: -9px;
opacity: 0;
font-size: 12px;
font-weight: normal;
& > div.protyle-attr--bookmark {
flex: 1;
}
& > div:not(.protyle-attr--refcount) {
margin: 0 4px;

View file

@ -39,8 +39,13 @@ svg {
display: flex;
opacity: 0;
font-size: 12px;
font-weight: normal;
& > div {
& > div.protyle-attr--bookmark {
flex: 1;
}
& > div:not(.protyle-attr--refcount) {
margin: 0 4px;
display: flex;
align-items: center;
@ -54,8 +59,8 @@ svg {
svg {
height: 12px;
width: 12px;
margin-right: 2px;
flex-shrink: 0;
margin: 2px 2px 0 0;
float: left;
}
}

View file

@ -106,7 +106,7 @@ const renderPDF = (id: string) => {
#action {
width: 200px;
background: var(--b3-theme-background-light);
padding: 16px;
padding: 12px;
position: fixed;
right: 0;
top: 0;
@ -132,6 +132,10 @@ const renderPDF = (id: string) => {
max-width: none;
}
.b3-switch {
margin-left: 14px;
}
.exporting::-webkit-scrollbar {
width: 0;
height: 0;
@ -151,8 +155,8 @@ const renderPDF = (id: string) => {
border-bottom: 1px solid var(--b3-theme-surface-lighter);
display: block;
color: var(--b3-theme-on-surface);
padding-bottom: 16px;
margin-bottom: 16px;
padding-bottom: 12px;
margin-bottom: 12px;
}
${setInlineStyle(false)}
</style>
@ -432,6 +436,7 @@ const renderPDF = (id: string) => {
scale: parseFloat(actionElement.querySelector("#scale").value),
pageSize: actionElement.querySelector("#pageSize").value,
},
left: previewElement.style.paddingLeft,
keepFold: keepFoldElement.checked,
mergeSubdocs: mergeSubdocsElement.checked,
removeAssets: actionElement.querySelector("#removeAssets").checked,
@ -440,7 +445,7 @@ const renderPDF = (id: string) => {
})
actionElement.remove();
previewElement.classList.add("exporting");
previewElement.style.paddingTop = "0";
previewElement.style.paddingTop = "6px";
previewElement.style.paddingBottom = "0";
});
setPadding();
@ -454,7 +459,7 @@ const renderPDF = (id: string) => {
modal: true,
show: true,
width: 1032,
height: 618,
height: 638,
resizable: false,
frame: "darwin" === window.siyuan.config.system.os,
icon: path.join(window.siyuan.config.system.appDir, "stage", "icon-large.png"),

View file

@ -378,6 +378,11 @@ const initWindow = () => {
mergeSubdocs: ipcData.mergeSubdocs,
})));
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) => {
fetchPost("/api/export/exportHTML", {
id: ipcData.rootId,