Skip to content

The Open Source DocuSign Alternative.

🚧 signature placement

Timur Ercan15cecace4ed4
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),