I'm using this code to disable Print options:
- Code: Select all
using (MemoryStream memoryStreamWriter = new MemoryStream())
{
PdfDocument doc = new PdfDocument(memoryStreamReader);
doc.Security.Encrypt("TEST", permissionsFlags);
doc.SaveToStream(memoryStreamWriter, Spire.Pdf.FileFormat.PDF);
return memoryStreamWriter.ToArray();
}
Where permissionsFlags = None.
But, when I open the document show an error code (see image I've attached)
But, if I remove this line:
- Code: Select all
doc.Security.Encrypt("TEST", permissionsFlags);
The PDF is shown correctly.
What's my problem?
Regards,