Этот класс преобразует UIImage в документ PDF и, будем надеяться, поможет всем, кто хочет это сделать.(недостатком является то, что если эти UIImages большие, сжатия нет)
public static Stream CreatePDF (UIImage image)
{
NSMutableData data = new NSMutableData();
UIGraphics.BeginPDFContext(data, new RectangleF(new PointF(0,0), image.Size), null);
UIGraphics.BeginPDFPage(new RectangleF(new PointF(0,0), image.Size), null);
image.Draw(new RectangleF(0, 0, image.Size.Width, image.Size.Height));
UIGraphics.EndPDFContent();
using (NSData imageData = data)
{
Byte[] myByteArray = new Byte[imageData.Length];
System.Runtime.InteropServices.Marshal.Copy (imageData.Bytes, myByteArray, 0, Convert.ToInt32(imageData.Length));
fs = new MemoryStream(myByteArray);
}
return fs;
}