1
0
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:
2024-10-22 20:53:39 +00:00
parent 8dd26ef22a
commit 77546dfde6
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -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();