Skip to content

SignPdf

Drag-and-drop PDF signing with fixed placement, non-overlapping markers, and PDF export. The layout combines upload controls, zoom, signer list, and a JSON sync channel so you can restore signature positions after reload.

Example

Drag user chips into the canvas area to pin a signature where it belongs. This demo keeps signature positions in JSON so you can copy/paste them to restore after refresh. SignPdf handles upload, drag/drop, and signing UI.

Code
vue
<script setup lang="ts">
import { ref } from 'vue'
import { SignPdf } from '@point-hub/papp'

const demoUsers = [
  { id: 'alya', name: 'Alya Rahma', initials: 'AR', label: 'Menyetujui' },
  { id: 'dimas', name: 'Dimas Pratama', initials: 'DP', label: 'Mengetahui' }
]
const currentUser = demoUsers[0]
const signaturesJson = ref('')
</script>

<template>
  <SignPdf v-model:signaturesJson="signaturesJson" :users="demoUsers" :current-user="currentUser" />
  <base-textarea
    v-model="signaturesJson"
    label="Signature JSON"
    layout="vertical"
    description="Paste to restore positions."
    class="mt-4"
    :minHeight="180"
    placeholder="Paste signature JSON di sini..."
    spellcheck="false"
  />
</template>

SignPdf API

Types

ts
export interface SignPdfUser {
  id: number | string
  name: string
  initials?: string
  role?: string
  label?: string
}

export interface PdfSignerSignature {
  id: string
  x: number
  y: number
  width: number
  height: number
  page: number
  userId: number | string | null
  name: string
  initials: string
  label?: string
  signed: boolean
}

Props

PropTypeDefaultDescription
usersSignPdfUser[]built-in demo listSigners that can be dragged to the canvas.
currentUser`SignPdfUsernull`null
pdfUrlstring''PDF source URL to load immediately.
enableUploadbooleantrueShow or hide the built-in upload control.
signaturesJsonstring''JSON string representing signatures (used with v-model:signaturesJson).

Events

This component emits update:signaturesJson for v-model sync and signature lifecycle events. See the source if you need to hook into them.

Released under the MIT License.