endpoint
Sign
POST /api/v1/sign
Apply a visual signature (typed or image). For cryptographic PAdES signing see /sign/digital.
credits: 1returns: application/pdf
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file | multipart file | required | Source PDF. |
| mode | "type" | "image" | required | Signature style. |
| field | JSON string | required | { page, x, y, width, height } |
| typedName | string | optional | Required when mode=type. |
| signatureImage | multipart file | optional | Required when mode=image. |
| timestamp | boolean | optional | Stamp "signed at <ts>" footer. |
| signerName | string | optional | Footer text. |
| signerEmail | string | optional | Footer text. |
Examples
curl
curl -X POST https://api.snappdf.au/api/v1/sign \
-H "Authorization: Bearer $SNAPPDF_API_KEY" \
-F "file=@contract.pdf" -F "mode=type" -F "typedName=Jane Smith" \
-F 'field={"page":1,"x":100,"y":100,"width":200,"height":50}' \
-o signed.pdfJavaScript
await snap.pdf.sign({ file: bytes, mode: 'type', field: {page: 1, x: 100, y: 100, width: 200, height: 50}, typedName: 'Jane Smith' });Python
snap.pdf.sign(file=bytes, mode="type", field={"page":1,"x":100,"y":100,"width":200,"height":50}, typed_name="Jane Smith")PHP
$snap->pdf->sign(file: $bytes, mode: 'type', field: ['page'=>1,'x'=>100,'y'=>100,'width'=>200,'height'=>50], typedName: 'Jane Smith');Ruby
snap.pdf.sign(file: bytes, mode: 'type', field: {page:1,x:100,y:100,width:200,height:50}, typed_name: 'Jane Smith')Go
client.Sign(ctx, &snappdf.SignInput{File: bytes, Mode: "type", Field: snappdf.SignField{Page:1, X:100, Y:100, Width:200, Height:50}, TypedName: "Jane Smith"})