PDF Signer Is Not a PKCS#7 Digital Signature
• 4 min read
Docify does not digitally sign a PDF in the certificate sense. Sign and download loads the file with PDFDocument.load, embeds canvas.toDataURL() via embedPng, and draws it on page 1 at 150×50 pt. That is not PKCS#7, not PAdES, and not a typed-name or uploaded-image signer. The pad is mouse-only. Nothing is uploaded.
The slug says “digitally,” but the live PDF signer only stamps a PNG. For the exact embed steps, see stamp a drawn signature on page 1. For ESIGN / eIDAS and audit-trail overclaims, see visual stamp vs electronic signature.
Buttons on the page
- Upload PDF — a label around a hidden
application/pdfinput. Non-PDF MIME types are rejected withalert(). - Sign and download — disabled while
!pdfFile || !signatureData. Walks page 1 only and savessigned-document.pdf. - Clear (toolbar) — disabled while there is no PDF and no stored data URL. Drops the object URL, the file, and the canvas.
- Clear (on the Signature card) —
clearRectthe 500×200 pad and dropssignatureData. The PDF preview stays.
What the old “digital signature” tips were not
- Not a typed name, uploaded signature image, or mobile-first touch pad. There are no touch handlers.
- Not a placement control or a signing-date field. The PNG always lands at 50, 50 on page 1.
- Not PKCS#7, PAdES, or a certificate. “Digitally sign” in the old title overstated a visual stamp.
Draw, then stamp page 1
Mouse or trackpad only. Not a certificate signature. Files stay on the device.
Use PDF Signer →FAQ
- Is this a certificate-based digital signature?
- No. Sign and download embeds a PNG of the canvas drawing with pdf-lib embedPng and drawImage. It does not create a PKCS#7 or PAdES signature, attach a certificate, or prove identity. Treat it as a visual stamp only.
- Can I place the stamp anywhere or on later pages?
- No. Only getPages()[0] is used. drawImage is fixed at x: 50, y: 50 with width 150 and height 50. There is no drag handle, no page picker, and no “add date” field. The old “position it wherever needed” tip was not about this page.
- Can I draw with a finger on a phone?
- The pad has mouse down/move/up/leave handlers mapped through getBoundingClientRect. There are no touch handlers. A phone browser may not draw a usable stroke. The helper text says “Draw with your mouse or trackpad.”
- What happens if I pick a non-PDF file?
- handlePDFUpload checks file.type === "application/pdf". Anything else shows alert("Please upload a valid PDF file") and does not set the iframe. Signing errors use alert("Error signing PDF: " + error.message).