How do I save FDF data to a stream or buffer?

Q: Is there any way to save FDFDoc to a byte array or memory stream? I only see the option to save to a file. I have seen references to this in some API documents (Java I think), but not in the .Net library. Was this maybe from an old version? We are looking into saving the FDF files to a database or some non-file system based storage and would like to avoid having to save to disk first if we don’t have to.

A:
The FDFDoc class uses SDFDoc under the hood, and SDFDoc has these methods. The following code will do what you want.

byte[] fdf_data = fdfDoc.GetSDFDoc().Save(SDFDoc.SaveOptions.e_remove_unused | SDFDoc.SaveOptions.e_compatibility, "%FDF-1.2");

Hi,
please do you have a example in swift ore Obj-c?

Dňa streda, 11. marca 2015 1:23:20 UTC+1 Ryan napísal(-a):

Q: Is there any way to save FDFDoc to a byte array or memory stream? I only see the option to save to a file. I have seen references to this in some API documents (Java I think), but not in the .Net library. Was this maybe from an old version? We are looking into saving the FDF files to a database or some non-file system based storage and would like to avoid having to save to disk first if we don’t have to.

A:
The FDFDoc class uses SDFDoc under the hood, and SDFDoc has these methods. The following code will do what you want.

byte[] fdf_data = fdfDoc.GetSDFDoc().Save(SDFDoc.SaveOptions.e_remove_unused | SDFDoc.SaveOptions.e_compatibility, "%FDF-1.2");

ObjC/Swift samples are here.
https://www.pdftron.com/documentation/samples?platforms=ios#fdf

https://www.pdftron.com/documentation/samples?platforms=ios#sdf