if (igDocument is ImGearPDFDocument)
{
ImGearPDFDocument pdfDoc = igDocument as ImGearPDFDocument;
using (MemoryStream mem = new MemoryStream())
{
pdfDoc.Save(mem, ImGearSavingFormats.PDF, 0, 0, pdfDoc.Pages.Count, ImGearSavingModes.OVERWRITE);
using (FileStream file = new FileStream(savePath, FileMode.OpenOrCreate))
{
byte[] bytes = mem.ToArray();
file.Write(bytes, 0, bytes.Length);
}
}
}
If TypeOf igDoc Is ImGearPDFDocument Then
Dim pdfDoc As ImGearPDFDocument
pdfDoc = igDoc
'Dim mem As MemoryStream
Using mem As New MemoryStream()
pdfDoc.Save(mem, ImGearSavingFormats.PDF, 0, 0, pdfDoc.Pages.Count, ImGearSavingModes.OVERWRITE)
Using file As New FileStream(savePath, FileMode.OpenOrCreate)
Dim bytes() As Byte
bytes = mem.ToArray()
file.Write(bytes, 0, bytes.Length)
End Using
End Using
End If