I'm successfully using AutoFiller, setting the OutputStream to Response.OutputStream. That works great, however, now I'd like to combine DocumentPrivileges, but I can't quite get the combination to work. Do you have a suggestion on how I can get the following to work?
Specifically, the code seems to have trouble in working with the output stream. Obviously I'm trying to route the AutoFiller output to the Reponse.OutputStream.
Many thanks... Mike
// Reset the response headers and perform the merge
Response.Expires = 0;
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment; filename=" + tempFN);
Response.ContentType = "application/pdf";
autoFiller.OutputStream = Response.OutputStream;
// Enable security
DocumentPrivilege privilege = DocumentPrivilege.ForbidAll;
privilege.AllowPrint = true;
privilege.AllowCopy = true;
privilege.AllowFillIn = true;
PdfFileSecurity fileSecurity = new PdfFileSecurity(autoFiller.OutputStream, autoFiller.OutputStream);
fileSecurity.EncryptFile("abc", "abc", privilege, false);