I am having the same error on the current version (6.0)
{"Path cannot be null.\r\nParameter name: path"}
Here is the code:
certStream.Seek(0,
SeekOrigin.Begin);
//PdfFileSignature pdfSign = new PdfFileSignature(fNameIn, fNameOut);
PdfFileSignature pdfSign = new PdfFileSignature();
ms.Seek(0,
SeekOrigin.Begin);
pdfSign.BindPdf(ms);
ms.Dispose();
System.Drawing.
Rectangle rect = new System.Drawing.Rectangle(480, 523, 300, 35);
pdfSign.CertificationLevel =
PdfFileSignature.CertifiedNoChangeAllowed;
Pkcs1Signature signature = new Pkcs1Signature(certStream, encPwd); // PKCS#1 or
signature.Reason = coSignerInfo;
signature.Name = Context.User.Identity.Name;
signature.Location =
"";
signature.Contact = Context.User.Identity.Name;
pdfSign.Sign(
string.Format("CoSign{0}", (i + 1).ToString()), signature);
ms =
new MemoryStream();
pdfSign.Save((
MemoryStream)ms);
Here is the stack trace:
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
at xeb116a323308e2f7.x34d3ddaf504aefea.xd1e589c3e6c349cd(String x4a21632d4ad5636b, Signature x2f9ad81484440792)
at xeb116a323308e2f7.x3233d061fc77cddd.close(String inputFile, Signature sig)
at Aspose.Pdf.Kit.PdfFileSignature.xd68275b7e3d98460(Stream xf823f0edaa261f3b, x7759a935a2782a02 x618aa16cc0d53b64)
at Aspose.Pdf.Kit.PdfFileSignature.Save(Stream outputStream)
at coSignLog(Byte[] cert, Byte[] maLog) in C:\Visual Studio MACoSignLog.aspx.cs:line 751
at SolutionsCubed.Provider.CoSignMALog.btnCoSign_OnClick(Object sender, EventArgs e) in C:\Visual Studio MACoSignLog.aspx.cs:line 151
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)