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:
@@ -2,8 +2,6 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import puppeteer from "puppeteer-core";
|
||||
import chrome from "@sparticuz/chromium";
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
|
||||
export async function POST(req: Request) {
|
||||
try {
|
||||
@@ -14,12 +12,7 @@ export async function POST(req: Request) {
|
||||
// });
|
||||
|
||||
const browser = await puppeteer.launch({
|
||||
args: [
|
||||
...chrome.args,
|
||||
"--no-sandbox",
|
||||
"--disable-setuid-sandbox",
|
||||
"--font-render-hinting=none"
|
||||
],
|
||||
args: chrome.args,
|
||||
// defaultViewport: chrome.defaultViewport,
|
||||
executablePath: await chrome.executablePath(
|
||||
`https://github.com/Sparticuz/chromium/releases/download/v126.0.0/chromium-v126.0.0-pack.tar`
|
||||
@@ -31,8 +24,6 @@ export async function POST(req: Request) {
|
||||
|
||||
await page.setContent(content);
|
||||
|
||||
await page.evaluate(() => document.fonts.ready);
|
||||
|
||||
const marginPx = margin + "px";
|
||||
|
||||
const pdf = await page.pdf({
|
||||
|
||||
Reference in New Issue
Block a user