diff --git a/.env.development b/.env.development index fa58c26..4aba1d3 100644 --- a/.env.development +++ b/.env.development @@ -11,6 +11,7 @@ SMTP_TO_EMAIL=email # Email to which emails will be sent DOMAIN_NAME=example.com # Your domain name RESUME_URL=URL # Location of the resume PDF +RESUME_HAS_REFS=false # Appends last page of the resume to a result PDF file ALERT_TEXT_URL=URL # URL of a txt file with urgent message to be displayed (see app/_components/AlertMessage.tsx) CLARITY_ID=string # Clarity Analytics ID (optional, remove to disable) CLARITY_CONSENT=1 # 1 if you need to request explicit consent from user, 0 if not (requires CLARITY_ID) diff --git a/app/resume/download/route.ts b/app/resume/download/route.ts index f30fcb5..981f20b 100644 --- a/app/resume/download/route.ts +++ b/app/resume/download/route.ts @@ -27,9 +27,12 @@ export async function GET(req: NextRequest): Promise // 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();