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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -