Hello,
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.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=" + tempFN);
Response.ContentType = "application/pdf";
autoFiller.OutputStream = Response.OutputStream;
autoFiller.ImportDataTable(workingTable);
autoFiller.Save();
// Enable security
if (pdfEncrypt)
{
DocumentPrivilege privilege = DocumentPrivilege.ForbidAll;
if (pdfAllowPrint)
privilege.AllowPrint = true;
if (pdfAllowCopy)
privilege.AllowCopy = true;
if (pdfAllowFill)
privilege.AllowFillIn = true;
PdfFileSecurity fileSecurity = new PdfFileSecurity(autoFiller.OutputStream, autoFiller.OutputStream);
fileSecurity.EncryptFile("abc", "abc", privilege, false);
}
Response.End();