ImageGear21.Formats.Pdf Assembly > ImageGear.Formats.PDF Namespace > ImGearPDFDocument Class > Save Method : Save(Stream,ImGearSavingFormats,Int32,Int32,Int32,ImGearSavingModes) Method |
'Declaration Public Overloads Sub Save( _ ByVal stream As Stream, _ ByVal format As ImGearSavingFormats, _ ByVal startPageInStream As Integer, _ ByVal startPage As Integer, _ ByVal pageCount As Integer, _ ByVal saveMode As ImGearSavingModes _ )
'Usage Dim instance As ImGearPDFDocument Dim stream As Stream Dim format As ImGearSavingFormats Dim startPageInStream As Integer Dim startPage As Integer Dim pageCount As Integer Dim saveMode As ImGearSavingModes instance.Save(stream, format, startPageInStream, startPage, pageCount, saveMode)
public void Save( Stream stream, ImGearSavingFormats format, int startPageInStream, int startPage, int pageCount, ImGearSavingModes saveMode )
public: void Save( Stream* stream, ImGearSavingFormats format, int startPageInStream, int startPage, int pageCount, ImGearSavingModes saveMode )
public: void Save( Stream^ stream, ImGearSavingFormats format, int startPageInStream, int startPage, int pageCount, ImGearSavingModes saveMode )
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