mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 08:42:12 +10:00
feat: add name field
Adds support for a name field which will be prefilled with the recipients name if they haven't signed a form on Documenso before.
This commit is contained in:
@ -8,7 +8,8 @@ export async function insertTextInPDF(
|
||||
positionX: number,
|
||||
positionY: number,
|
||||
page: number = 0,
|
||||
useHandwritingFont = true
|
||||
useHandwritingFont = true,
|
||||
fontSize = 15
|
||||
): Promise<string> {
|
||||
const fontBytes = fs.readFileSync("public/fonts/Qwigley-Regular.ttf");
|
||||
|
||||
@ -21,7 +22,7 @@ export async function insertTextInPDF(
|
||||
const pages = pdfDoc.getPages();
|
||||
const pdfPage = pages[page];
|
||||
|
||||
const textSize = useHandwritingFont ? 50 : 15;
|
||||
const textSize = useHandwritingFont ? 50 : fontSize;
|
||||
const textWidth = font.widthOfTextAtSize(text, textSize);
|
||||
const textHeight = font.heightAtSize(textSize);
|
||||
const fieldSize = { width: 192, height: 64 };
|
||||
|
||||
Reference in New Issue
Block a user