I want to add a written signature to an existing PDF document.
I would prefer to use an Image XObject in an annotation, but unless I'm overlooking it, there doesn't appear to be a way to create an annotation that shows an image. So now I'm thinking that the only way to add an image to the page is to create a content stream that shows an Image XObject, and add the stream to the page's '/Contents' array?
The other way that I've found is to vectorize the signature and use an Ink Annotation, which seems pretty straightforward, but would require a lot of changes to my signature capturing system.
Any other options that I'm overlooking?
Don't look for annotations, look at the form field capabilities: You can
add a button with an image as the button face. That's a fairly straight
forward process to bring an image into a PDF file. Once the button is in
the PDF, you can then flatten the page to "burn" the image into the PDF so
that it's no longer an interactive button.
Karl Heinz Kremer
PDF Acrobatics Without a Net
I originally wanted to have a text field with an image of the signature using /AP, but I found that some PDF viewers ignore the /AP for text fields even if there is no value (/V) present, so I had decided that /AP wasn't reliable enough. But when I changed the annotation to a button or a stamp, it solved the problem and the /AP now shows in all the PDF viewers I tried.
I'm actually having the best luck using a disabled button because when I use a stamp, the MacOS PDF viewer oddly lets you move the stamp around, and I don't want it to be possible to move it.