mirror of
https://github.com/XFox111/my-website.git
synced 2026-04-22 07:28:01 +03:00
feat: references page can be appended to resume
This commit is contained in:
@@ -27,9 +27,12 @@ export async function GET(req: NextRequest): Promise<Response>
|
||||
|
||||
// Create a new PDF document with the specified page
|
||||
const newDoc: PDFDocument = await PDFDocument.create();
|
||||
const [page]: PDFPage[] = await newDoc.copyPages(srcDoc, [resume.pageIndex]);
|
||||
const [page, refs]: PDFPage[] = await newDoc.copyPages(srcDoc, [resume.pageIndex, srcDoc.getPageCount() - 1]);
|
||||
newDoc.addPage(page);
|
||||
|
||||
if (process.env.RESUME_HAS_REFS)
|
||||
newDoc.addPage(refs);
|
||||
|
||||
// Serialize the new PDF document
|
||||
const pdfBytes: Uint8Array = await newDoc.save();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user