Please make sure the PDF you are trying to encrypt is in PDF 1.4 Acrobat 5.0 format or disable encryption. Exact error: No stream given.