FYI: The current version of PDFNet includes high-level signature API. For more info please see:
On Thursday, July 26, 2012 1:55:26 PM UTC-7, Qamar Suleiman wrote:
Hi Vincent,
Thanks for your generous reply. Could you please tell me how could I do do that
"
// now that the document is serialized, calculate the signature by the reading the bytes specified by the /ByteRange, then write this signature in
// the /Contents entry.
"
I would really appreciate if you could put some code in here, especially if its C or Objective C Code
Thanks,
Qamar
On Thursday, July 26, 2012 2:29:57 PM UTC-4, Vincent Ycasas wrote:
Using PDFNet, you can add digital signatures to an
existing signature field by using the low-level COS/SDF
API. The following code snippet describes this process:
Field sigFld = doc.GetField(UString("mysigfield"));
// create a signature dictionary and assign this
dictionary as sigFld's value
SDF::Obj sigDict = doc.CreateIndirectDict();
// add the needed information in the sigDict like
ByteRange, Filter, etc.
sigDict.PutName("Type", "Sig");
sigDict.PutName("Filter",
"MyFilter");
SDF::Obj byteRange = sigDict.PutArray("ByteRange");
// add the required byte ranges to the byteRange Array
sigDict.PutString("Contents", "0000"); // it will be
necessary to put enough space in the contents field so
that the final signature calculated will fit.
sigFld.SetValue(sigDict);
// save the PDFDoc
doc.Save(...);
// now that the document is serialized, calculate the
signature by the reading the bytes specified by the
/ByteRange, then write this signature in
// the /Contents entry.
We will be adding digital signatures API for the next major
update of PDFNet. Please keep checking the website for news
and update.