mirror of
https://github.com/JOYCEQL/magic-resume.git
synced 2026-07-03 14:07:11 +02:00
fix: pdf font
This commit is contained in:
@@ -26,7 +26,6 @@ export async function POST(req: Request) {
|
||||
const pdfContent = `
|
||||
<html>
|
||||
<head>
|
||||
<style>${styles}</style>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'Noto Sans SC';
|
||||
|
||||
@@ -22,17 +22,17 @@ export function PdfExport() {
|
||||
line.style.display = "none";
|
||||
});
|
||||
const pdfContent = await convertImagesToBase64(pdfElement);
|
||||
let styles = Array.from(document.styleSheets)
|
||||
.map((sheet) => {
|
||||
try {
|
||||
return Array.from(sheet.cssRules)
|
||||
.map((rule) => rule.cssText)
|
||||
.join("\n");
|
||||
} catch (e) {
|
||||
return "";
|
||||
}
|
||||
})
|
||||
.join("\n");
|
||||
// let styles = Array.from(document.styleSheets)
|
||||
// .map((sheet) => {
|
||||
// try {
|
||||
// return Array.from(sheet.cssRules)
|
||||
// .map((rule) => rule.cssText)
|
||||
// .join("\n");
|
||||
// } catch (e) {
|
||||
// return "";
|
||||
// }
|
||||
// })
|
||||
// .join("\n");
|
||||
|
||||
const response = await fetch("/api/generate-pdf", {
|
||||
method: "POST",
|
||||
@@ -41,7 +41,7 @@ export function PdfExport() {
|
||||
},
|
||||
body: JSON.stringify({
|
||||
content: pdfContent,
|
||||
styles: styles,
|
||||
// styles: styles,
|
||||
margin: globalSettings.pagePadding
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user