C# convert PdfFileMend to byte[]

hello,
can I convert PdfFileMend object to byte array? and how?
thanks!

@rut

I suggest you to try the following code and share your feedback.

MemoryStream stream = new MemoryStream();
mend.Save(stream);
long bytes = stream.Length;
BinaryReader reader = new BinaryReader(stream);          
byte[] bytearray = reader.ReadBytes((int)bytes);

thanks!! it’s helped me!
I use more shorted code:
MemoryStream stream = new MemoryStream();
mender.Save(stream);
byte[] requestDetailsByte = stream.ToArray();

@rut

It’s good to hear that things are working on your end.