From 15cecace4ed4a1d77f2e34a42a3d033d5f46c64a Mon Sep 17 00:00:00 2001 From: Timur Ercan Date: Tue, 7 Mar 2023 16:21:57 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20signature=20placement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/pdf/insertTextInPDF.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/pdf/insertTextInPDF.ts b/packages/pdf/insertTextInPDF.ts index a05960d70..d7e829069 100644 --- a/packages/pdf/insertTextInPDF.ts +++ b/packages/pdf/insertTextInPDF.ts @@ -24,10 +24,12 @@ export async function insertTextInPDF( const textSize = useHandwritingFont ? 50 : 15; const textWidth = customFont.widthOfTextAtSize(text, textSize); const textHeight = customFont.heightAtSize(textSize); + const fieldSize = { width: 192, height: 64 }; + const invertedYPosition = pdfPage.getHeight() - positionY - fieldSize.height; pdfPage.drawText(text, { x: positionX, - y: pdfPage.getHeight() - positionY - textHeight / 2, + y: invertedYPosition, size: textSize, font: useHandwritingFont ? customFont : helveticaFont, color: rgb(0, 0, 0),