Skip to content

Instantly share code, notes, and snippets.

@Polaringu
Last active May 3, 2017 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Polaringu/30ad4c094ac0fa730953c46fc0a8a644 to your computer and use it in GitHub Desktop.
Save Polaringu/30ad4c094ac0fa730953c46fc0a8a644 to your computer and use it in GitHub Desktop.
private void AddSignatureWithTemplate(IPXV_Inst Inst, IPXV_Document Doc)
{
int nID = Inst.Str2ID("op.document.addDigitalSignature", false);
IOperation Op = Inst.CreateOp(nID);
ICabNode input = Op.Params.Root["Input"];
input.Add().v = Doc;
ICabNode options = Op.Params.Root["Options"];
options["PageNumber"].v = 0;
options["UseFileCertificate"].v = true;
options["DigiSigType"].v = 1;
options["FileCertificate"].v = @"D:\111111.pfx";
options["CertificatePassword"].v = "111111";
options["AskDestinationFileName"].v = true;
ICabNode appear = options["SignatureAppearance"];
appear["HasTemplate"].v = true;
ICabNode tmplt = appear["Template"];
tmplt["GraphicType"].v = 2;
tmplt["GraphicName"].v = @"D:\sig.bmp";
tmplt["ShowName"].v = true;
tmplt["ShowDate"].v = true;
Op.Do();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment