Compare commits
1 commit
master
...
fix/xlsx-e
| Author | SHA1 | Date | |
|---|---|---|---|
| 15d8a0bc3b |
1 changed files with 5 additions and 2 deletions
|
|
@ -478,11 +478,14 @@ export async function GET(request: NextRequest, { params }: Props) {
|
|||
const sigExt = signatureBase64 ? scaleToBox(signatureSize ?? { width: 360, height: 96 }, 165, 44) : null;
|
||||
const sigLeft = sigExt ? Math.round((SIG_BLOCK_PX - sigExt.width) / 2) : 0; // centred over the name
|
||||
|
||||
// Stamp / seal — drawn FIRST so it sits BEHIND the signature, tucked to its right.
|
||||
// Stamp / seal — placed to the RIGHT of the signature with a gap, so it never
|
||||
// overlays the signature or name (stamps/signatures aren't always transparent PNGs).
|
||||
// Still drawn before the signature so it layers behind if they ever touch.
|
||||
if (stampImg) {
|
||||
const stampExt = scaleToBox(stampImg, 80, 66);
|
||||
const STAMP_GAP = 10;
|
||||
const stampLeft = sigExt
|
||||
? Math.min(SIG_BLOCK_PX - stampExt.width, sigLeft + sigExt.width - Math.round(stampExt.width * 0.35))
|
||||
? Math.min(SIG_BLOCK_PX - stampExt.width, sigLeft + sigExt.width + STAMP_GAP)
|
||||
: SIG_BLOCK_PX - stampExt.width - 6;
|
||||
const stampId = wb.addImage({
|
||||
base64: stampImg.base64,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue