We are working on the digital signature now. As part of our application, we required to extract the signature image. We able to extract the annotations as FDF format. But, we couldn’t do the same with signature image. Could you please tell us how do we export the signature image from the pdf ?
The “signature” annotation widget, which is the visual appearance of the actual underlying digital signature, is not necessarily an image. It can be any arbitrary PDF content.
The code below will isolate the appearance of any annotation, into its own page, which can then be used for a variety of purposes, including converting to image, but could also be used for stamping.
void ProcessElements(ElementReader reader, ElementWriter writer, List visited)
while((element = reader.Next()) != null)
if(element.GetType() == Element.Type.e_form)
Obj form_obj = element.GetXObject();
if (!visited.Contains(form_obj.GetObjNum())) // if this XObject has not been processed
// recursively process the Form XObject
ElementWriter new_writer = new ElementWriter();
ProcessElements(reader, new_writer, visited);
List visited = new List();
// annot.RefreshAppearance(); // optional
Obj app_obj = annot.GetAppearance();
Page page = doc.PageCreate(Rect(-7200, -7200, 7200, 7200)); // max page dimension in pdf spec
ElementReader reader = new ElementReader();
ElementWriter writer = new ElementWriter();
ProcessElements(reader, writer, visited);
page.SetMediaBox(page.GetVisibleContentBox()); // reduce back to bbox
// at this point you have a page that contains just the digital signature
// you can now use PDFDraw or PDFRasterizer to create an image however you like