Add clickable link to PDF footer and remove owner check for download but
This commit is contained in:
@@ -51,8 +51,14 @@ export async function GET(request: NextRequest) {
|
|||||||
pdf.addImage(imgData, 'JPEG', 10, 10, 190, 277); // A4 portrait size minus margins
|
pdf.addImage(imgData, 'JPEG', 10, 10, 190, 277); // A4 portrait size minus margins
|
||||||
|
|
||||||
// Add "Created by Make Comics" at the bottom
|
// Add "Created by Make Comics" at the bottom
|
||||||
pdf.setFontSize(8);
|
pdf.setFont('helvetica', 'bold');
|
||||||
pdf.text('Created by Make Comics', 105, 290, { align: 'center' });
|
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'));
|
const pdfBuffer = Buffer.from(pdf.output('arraybuffer'));
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export function EditorToolbar({
|
|||||||
<span>Share</span>
|
<span>Share</span>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{isOwner && onDownloadPDF && (
|
{onDownloadPDF && (
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
className="hover:bg-secondary text-muted-foreground hover:text-white gap-1.5 sm:gap-2 text-xs h-8 sm:h-9 px-2 sm:px-3"
|
className="hover:bg-secondary text-muted-foreground hover:text-white gap-1.5 sm:gap-2 text-xs h-8 sm:h-9 px-2 sm:px-3"
|
||||||
|
|||||||
Reference in New Issue
Block a user