我有一个带有 Adobe 签名的签名 pdf,做得很好。当我想下载此文档时,我的问题就开始了。
通过 webmethod 我得到签名文件的字节。直到这里没有问题。
如果我尝试将文件保存在我的服务器中,当我打开文件时,一切都是正确的。但是,如果我在打开它时尝试下载它,则签名是错误的。
这是 adobe reader 中的错误:
“签名数据的范围由一系列意外字节定义。详细信息:签名的字节范围无效”
这是我下载文件的方式:
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename= Factura.pdf");
HttpContext.Current.Response.AddHeader("Content-Length", newStream.Length.ToString());
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.BufferOutput = true;
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.OutputStream.Write(newStream.GetBuffer(), 0, newStream.GetBuffer().Length);
HttpContext.Current.Response.OutputStream.Flush();
HttpContext.Current.ApplicationInstance.CompleteRequest();
谁能帮我解决这个问题?