here is the code snippet I use to encrypt my pdf. Please not the password (müller) with german umlaut characters. If I change it to ‘muller’ everything works fine.
Dim outputdoc As Aspose.Pdf.Document = Nothing
outputdoc = New Aspose.Pdf.Document("test_original.pdf")
Try
outputdoc.Encrypt("müller", "test", Aspose.Pdf.Permissions.FillForm Or Aspose.Pdf.Permissions.PrintDocument Or Aspose.Pdf.Permissions.PrintingQuality, Aspose.Pdf.CryptoAlgorithm.AESx256)
outputdoc.Save("test_output.pdf")
Console.WriteLine("password was set ")
Catch ex As Exception
Console.WriteLine("Error setting password PDF file:" + ex.Message)
End Try
Console.WriteLine("Press any key to finish")
Console.ReadKey()
Thomas