c# 4.0 - problems downloading signed pdf files c# -
i have signed pdf adobe signature done. problem starts when want download document.
via webmethod bytes of signed file. until here there no problems.
if try save file in server, when open file correct. if try download when open signature wrong.
this error in adobe reader:
"the scope of signed data defined range of unexpected bytes. details: range of bytes of signature invalid"
this way download file:
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();
can me problem?
you sending more bytes thos advertised in header. newstream.toarray()
, use byte array. other thing check if have bytes in newstream
, save file check (from toarray()
.
Comments
Post a Comment