Add clickable link to PDF footer and remove owner check for download but

This commit is contained in:
Riccardo Giorato
2025-12-27 12:16:10 +01:00
parent cb00498df1
commit 95a14c59fc
2 changed files with 9 additions and 3 deletions
+8 -2
View File
@@ -51,8 +51,14 @@ export async function GET(request: NextRequest) {
pdf.addImage(imgData, 'JPEG', 10, 10, 190, 277); // A4 portrait size minus margins
// Add "Created by Make Comics" at the bottom
pdf.setFontSize(8);
pdf.text('Created by Make Comics', 105, 290, { align: 'center' });
pdf.setFont('helvetica', 'bold');
pdf.setFontSize(12);
const text = 'Created by Make Comics';
const textX = 105;
const textY = 290;
pdf.text(text, textX, textY, { align: 'center' });
const dimensions = pdf.getTextDimensions(text);
pdf.link(textX - dimensions.w / 2, textY - dimensions.h / 2, dimensions.w, dimensions.h, { url: 'https://make-comics.vercel.app/' });
}
const pdfBuffer = Buffer.from(pdf.output('arraybuffer'));