Hi,
I am receiving the following error when attempting to forbid all permissions on the attached PDF document:
Unable to cast object of type 'xeb116a323308e2f7.xae94bcfc1c7ddd9a' to type 'xeb116a323308e2f7.x0b25947bdf0fba40'.
The code that I am using to generate this is as follows:
string pdfInFile = "C:\\PDFPreview_IN.pdf";
string pdfOutFile = "C:\\PDFPreview_OUT.pdf";
using (FileStream inStream = new FileStream(pdfInFile, FileMode.Open, FileAccess.Read))
using (FileStream outStream = new FileStream(pdfOutFile, FileMode.Create))
{
try
{
PdfFileSecurity security = new PdfFileSecurity(inStream, outStream);
security.SetPrivilege(DocumentPrivilege.ForbidAll);
using (Process process = new Process())
{
process.StartInfo = new ProcessStartInfo(pdfOutFile);
process.Start();
}
}
catch (Exception ex)
{
MessageBox.Show(this,
string.Format("An error occured securing {0}: {1}\r\n\r\n{2}",
pdfInFile, ex.Message, ex.StackTrace),
"Error Securing PDF",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
I should also point out that the version of PDF Kit I am using is 4.9.0.0, I am using the VS 2008 DLL (i.e. in the v3.5 folder).
Thanks
Dwayne