I am using following code to add password to office document and pdf files
using (FileStream fs = new FileStream(FilePath, FileMode.Open))
{
AddPasswordOptions options = new AddPasswordOptions(getFileFormat(FilePath), Password);
GroupDocs.Merger.Domain.Result.DocumentResult result = new DocumentHandler().AddPassword(fs, options);
fs.Close();
Stream documentStream = result.Stream;
var filestream = File.Create(OutputPath);
documentStream.CopyTo(filestream);
documentStream.Close();
filestream.Close();
}
My password it 255 charactors long for example like this
(BE$0iTrL9^OGe{{Mbc"aYaBvxFRt1lUys~Z(O\s<t_u’Wx_?D0{eR7e-28O[H^8}d%Sw"7SfnH+>Gr?#c-)Z4;Qs^/G=dO}?.bI.D=UT2i?iT.3Z4fnf;R@PP|;3,BM@A><)lx8ZfBnW$<"@pi3ZCVr6bXm.&3|kkLG2Gz}52.(]H@YX~Toh=qoCLy3%m[=*/PA}F(F}Xj’1H[dPIAWUrQy(j:MO^0qE0c%A=J%+"NM-QXhFc<2/+6haj/
after adding password pdf file cannot open manually by entering above password.
but word files works correctly
do yo have any idea of this