diff --git a/app/src/protyle/export/index.ts b/app/src/protyle/export/index.ts index bf0e48aae..4544155ac 100644 --- a/app/src/protyle/export/index.ts +++ b/app/src/protyle/export/index.ts @@ -65,62 +65,15 @@ const renderPDF = (id: string) => { const localData = JSON.parse(localStorage.getItem(Constants.LOCAL_EXPORTPDF) || JSON.stringify({ printBackground: true, landscape: false, - marginsType: 0, + margins: { + marginType: "default", + }, scaleFactor: 100, pageSize: "A4", removeAssets: true, keepFold: false, })); const servePath = window.location.protocol + "//" + window.location.host; - let pdfWidth = ""; - if (localData.pageSize === "A3") { - if (localData.landscape) { - pdfWidth = "16.5"; - } else { - pdfWidth = "11.7"; - } - } else if (localData.pageSize === "A4") { - if (localData.landscape) { - pdfWidth = "11.7"; - } else { - pdfWidth = "8.8"; - } - } else if (localData.pageSize === "A5") { - if (localData.landscape) { - pdfWidth = "8.3"; - } else { - pdfWidth = "5.8"; - } - } else if (localData.pageSize === "Legal") { - if (localData.landscape) { - pdfWidth = "14"; - } else { - pdfWidth = "8.5"; - } - } else if (localData.pageSize === "Letter") { - if (localData.landscape) { - pdfWidth = "11"; - } else { - pdfWidth = "8.5"; - } - } else if (localData.pageSize === "Tabloid") { - if (localData.landscape) { - pdfWidth = "17"; - } else { - pdfWidth = "11"; - } - } - let pdfMargin = "0.66"; - if (localData.landscape) { - pdfMargin = "1.69"; - } - if (localData.marginsType !== 0) { - if (localData.landscape) { - pdfMargin = "1.69"; - } else { - pdfMargin = "0.3"; - } - } const html = ` @@ -174,8 +127,6 @@ const renderPDF = (id: string) => { height: 100%; overflow: auto; box-sizing: border-box; - padding: 34px ${pdfMargin}in 16px; - width: ${pdfWidth}in } .b3-label { @@ -210,9 +161,9 @@ const renderPDF = (id: string) => {