//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; worksheet.PageSetup.Orientation = PageOrientation.Landscape; System.IO.Stream stream = this.GetResourceStream("logo.png"); GrapeCity.Documents.Excel.Drawing.IShape picture = worksheet.Shapes.AddPicture(stream, GrapeCity.Documents.Excel.Drawing.ImageType.PNG, 20, 20, 690, 100); // Save to a pdf file workbook.Save("SavePictureToPDF.pdf");
' Create a new Workbook Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) worksheet.PageSetup.Orientation = PageOrientation.Landscape Dim stream As IO.Stream = GetResourceStream("logo.png") Dim picture As IShape = worksheet.Shapes.AddPicture(stream, ImageType.PNG, 20, 20, 690, 100) ' save to a pdf file workbook.Save("SavePictureToPDF.pdf")