import { PDFDocument, rgb } from 'pdf-lib'; const pdfDoc = await PDFDocument.load(existingPdfBytes); const pages = pdfDoc.getPages(); const firstPage = pages[0]; firstPage.drawText('Your text here', { x: 100, y: 700, size: 20, color: rgb(0, 0, 1), }); const pdfBytes = await pdfDoc.save();