The old routine for "sign and send this back" is print, sign with a pen, scan, email. For most everyday paperwork you can skip the printer. Before you do, it's worth knowing that "signing a PDF" means two very different things, because only one of them is something you can do with a picture of your signature.
Two things both called a signature
A visible mark. An image of your signature (drawn, typed in a script font, or photographed) placed on the page. It looks signed. To the file, it's just more page content, like a logo.
A digital signature. A certificate, a hash of the document's bytes, and a signature that a PDF reader can check. Acrobat and similar readers show these in a signature panel, and they tell you if the file changed after signing. Nothing about it depends on what the page looks like.
A landlord, a school, a club, or a colleague asking for "a signed copy" almost always means the first. If the instructions mention a digital signature certificate (DSC), a qualified or advanced electronic signature, or a specific signing platform, they mean the second. No image tool, command or script can turn a picture into that. You need a certificate from a provider or your organisation's signing service.
Built-in ways to place a visible mark
macOS Preview. Open the PDF, show the Markup toolbar, and use the Sign button. You can create a signature with the trackpad, the camera (hold your signature on paper up to it), or an iPhone, and Preview saves it for reuse. Click it to place it, then drag and resize.
Adobe Acrobat Reader (Windows and Mac). The free reader has a Fill & Sign tool. Add a signature there by typing, drawing, or choosing an image, then click where it goes.
Either way, keep the original file. Once the mark is saved into a copy, you can't cleanly take it back out.
Turning a photo of your signature into a clean PNG
If you'd rather use your real ink signature, sign a sheet of white paper, photograph it straight down in daylight, and crop roughly. The photo won't be white and black. Paper in a phone photo is light grey with a gradient, and that grey travels with the image.
This Pillow script turns everything darker than a cutoff into opaque black ink and everything else into transparent pixels, then trims the empty margin:
import sys
from PIL import Image, ImageOps
src, dst = sys.argv[1], sys.argv[2]
cutoff = int(sys.argv[3]) if len(sys.argv) > 3 else 140 # 0-255, lower keeps less
gray = ImageOps.grayscale(Image.open(src))
# Ink becomes opaque black, paper becomes fully transparent.
alpha = gray.point(lambda v: 255 if v < cutoff else 0)
out = Image.new("RGBA", gray.size, (0, 0, 0, 0))
out.putalpha(alpha)
out = out.crop(alpha.getbbox()) # trim the empty margin
out.save(dst)
print(out.size)
python3 clean_signature.py signature-photo.jpg signature.png
On my test photo (900 x 360, grey paper getting lighter left to right, dark strokes) it produced a 766 x 178 RGBA PNG of 3,908 bytes. If faint parts of the stroke disappear, raise the cutoff. If paper texture or shadows show up as specks, lower it.
Stamping it onto a page from the command line
If you sign the same kind of document often, a script beats dragging things around. This one draws the PNG on a blank page of the same size with reportlab and lays that over the page you choose with pypdf (pip install pypdf reportlab):
import sys, io
from pypdf import PdfReader, PdfWriter
from reportlab.pdfgen import canvas
pdf_in, sig_png, pdf_out = sys.argv[1], sys.argv[2], sys.argv[3]
page_no = int(sys.argv[4]) # 1-based
x, y, width = map(float, sys.argv[5:8]) # points from bottom-left; 72 pt = 1 inch
reader = PdfReader(pdf_in)
writer = PdfWriter(clone_from=reader)
page = writer.pages[page_no - 1]
pw, ph = float(page.mediabox.width), float(page.mediabox.height)
# Draw the PNG on a blank page of the same size, then lay it over the real page.
buf = io.BytesIO()
c = canvas.Canvas(buf, pagesize=(pw, ph))
c.drawImage(sig_png, x, y, width=width, preserveAspectRatio=True,
anchor="sw", height=width, mask="auto")
c.save()
page.merge_page(PdfReader(buf).pages[0])
writer.write(pdf_out)
python3 stamp.py letter.pdf signature.png letter-signed.pdf 1 72 650 150
PDF coordinates start at the bottom-left corner, in points. An A4 page is about 595 x 842 points, so 72 650 is one inch from the left edge and a bit under a quarter of the way down from the top. 150 is the width of the mark in points, about 5.3 cm.
I checked the output three ways. The letter's text was still extractable as text after stamping, so the page wasn't flattened into a picture. Rendering the page with pdftoppm showed the signature sitting above the line with the text around it untouched. And the file went from 1,492 bytes to 5,739, since the PNG is small.
Checking which kind of signature a file has
pdfsig from poppler-utils lists the digital signatures in a PDF:
pdfsig letter-signed.pdf
For my stamped letter it printed File 'letter-signed.pdf' does not contain any signatures. That's the correct answer. The page has a mark, the file has no signature. Run it on a document you received with a real certificate signature and it lists the signer and whether the signature validates. It's a quick way to see which kind someone sent you, or which kind you're about to send.
Gotcha 1: a JPEG brings its paper with it
JPEG has no transparency. If you place the photo itself, you place a rectangle of grey paper. I stamped the original signature-photo.jpg at the same spot to compare: the grey box covered part of the "Yours faithfully," line above it, and the file grew to 42,120 bytes instead of 5,739. Use a PNG with a transparent background, like the one the script above makes.
Gotcha 2: adding a mark can break a signature that's already there
A digital signature covers a byte range of the file. If someone has already signed the document with a certificate and you add your mark with a tool that rewrites the whole file, like the script above, those bytes change and their signature stops validating. Acrobat avoids this by appending changes as an incremental update. If pdfsig shows an existing signature, add yours in a reader that preserves it, or ask the sender how they want it signed.
I built ToolOcean, a set of browser-based file tools. Its sign page places a drawn, typed or imported mark on one page in the browser tab, and says plainly that the result is not a certified or qualified signature: https://toolocean.co/pdf-sign
Drafted with AI help, tested and checked by me.
Top comments (0)