Forum Discussion
How to sign a PDF on laptop—do I need an electronic or digital signature?
Hi everyone,
I need to sign a PDF on my laptop, but the different signing options are a little confusing. Some guides explain how to type a name, draw a signature, or upload a signature image, while others mention certificates and digital signatures.
If I add a handwritten signature to a PDF, is that considered an electronic signature? How is it different from digitally signing a PDF, and how would I know which one a document requires?
I’d appreciate suggestions for tools that can electronically sign a PDF and tools for adding a digital signature. Is there one application that supports both, so I can choose whichever is needed?
Ideally, I’d like to sign a PDF for free and sign a PDF offline without uploading it, since some documents contain personal information.
Any advice or suggestions would be appreciated. Thanks for your help!
2 Replies
- Ryan_C1Brass Contributor
pyHanko is a free tool for certificate-based PDF signing. If you’re comfortable running a Python script, you can sign locally without uploading your document.
You’ll need a .p12 or .pfx file containing your signing certificate and private key. Install the library first:
python -m pip install pyHanko
Put input.pdf and your certificate, here named certificate.pfx, in the same folder as this script. Save it as sign_pdf.py:
from getpass import getpass
from pyhanko.sign import signers
from pyhanko.pdf_utils.incremental_writer import IncrementalPdfFileWriter
signer = signers.SimpleSigner.load_pkcs12(
"certificate.pfx",
passphrase=getpass("Certificate password: ").encode("utf-8"),
)
if signer is None:
raise RuntimeError("Unable to load the certificate and private key.")
with open("input.pdf", "rb") as source:
with open("signed.pdf", "wb") as destination:
signers.sign_pdf(
IncrementalPdfFileWriter(source),
signature_meta=signers.PdfSignatureMetadata(
field_name="Signature1"
),
signer=signer,
output=destination,
)
print("Created signed.pdf")Run it from that folder:
python sign_pdf.py
This adds a digital signature without a visible handwritten image. Open signed.pdf in a reader with signature validation to check it.
The signing operation works offline. However, a self-signed certificate may show as untrusted on someone else’s computer. If the recipient requires a trusted certificate, confirm what they accept before obtaining one.
- NathanReedBrass Contributor
If your laptop is a Mac, the built-in Preview app lets you add a handwritten signature to a PDF for free, without uploading the document.
- Open the PDF in Preview.
- Click Show Markup Toolbar, then Sign > Create Signature.
- Use the trackpad to write your signature, or the camera to capture your signature from white paper.
- Click the saved signature to insert it, then drag it into position and resize it.
- Save the PDF. Use File > Duplicate first if you want to keep an unsigned original.
A handwritten signature added this way is an electronic signature when used to sign the document. A certificate-based digital signature also provides a way to verify the signer’s certificate and detect changes made after signing. Preview’s signature tool doesn’t provide that.