mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
🚧 signature placement
This commit is contained in:
@ -24,10 +24,12 @@ export async function insertTextInPDF(
|
|||||||
const textSize = useHandwritingFont ? 50 : 15;
|
const textSize = useHandwritingFont ? 50 : 15;
|
||||||
const textWidth = customFont.widthOfTextAtSize(text, textSize);
|
const textWidth = customFont.widthOfTextAtSize(text, textSize);
|
||||||
const textHeight = customFont.heightAtSize(textSize);
|
const textHeight = customFont.heightAtSize(textSize);
|
||||||
|
const fieldSize = { width: 192, height: 64 };
|
||||||
|
const invertedYPosition = pdfPage.getHeight() - positionY - fieldSize.height;
|
||||||
|
|
||||||
pdfPage.drawText(text, {
|
pdfPage.drawText(text, {
|
||||||
x: positionX,
|
x: positionX,
|
||||||
y: pdfPage.getHeight() - positionY - textHeight / 2,
|
y: invertedYPosition,
|
||||||
size: textSize,
|
size: textSize,
|
||||||
font: useHandwritingFont ? customFont : helveticaFont,
|
font: useHandwritingFont ? customFont : helveticaFont,
|
||||||
color: rgb(0, 0, 0),
|
color: rgb(0, 0, 0),
|
||||||
|
|||||||
Reference in New Issue
Block a user