mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 09:12:02 +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 };
|
||||
|
||||
@ -0,0 +1,2 @@
|
||||
-- AlterEnum
|
||||
ALTER TYPE "FieldType" ADD VALUE 'NAME';
|
||||
@ -101,6 +101,7 @@ model Recipient {
|
||||
}
|
||||
|
||||
enum FieldType {
|
||||
NAME
|
||||
SIGNATURE
|
||||
FREE_SIGNATURE
|
||||
DATE
|
||||
|
||||
Reference in New Issue
Block a user