Guide for VB.NET
Core Document Formats
Excel to Other Raster Image Formats (Gif, Png, Jpeg)
Additional Features

VB.NET Excel - Convert to Other Raster Images

Convert Excel to Other Raster Images With VB.NET Excel Converting Library

VB.NET
Home > .NET Imaging SDK > VB.NET > Excel to Other Raster Image Formats
To get started with DocImage SDK for .NET, you are supposed to read VB.NET Imaging: Get Started first!

RasterEdge Excel Converting Control in VB.NET program is perfectly developed to render and convert single or batch Excel pages (for all applications of Excel document SDK, we call each Excel worksheet as page) into raster images, for instance, BMP (find VB.NET tutorial for Excel to BMP conversion), JPEG, PNG and GIF.
Related .net document control helps:
asp.net view excel in browser: ASP.NET Excel Viewer in C# Control (MVC & WebForms): view Office Excel document in web browser.
document viewer asp.net c#: ASP.NET Document Viewer using C#: Open, View, Annotate, Redact, Convert document files in ASP.NET using C#, HTML5, JQuer...
asp.net mvc display tiff: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control
asp.net office viewer: ASP.NET Office Word Document Viewer: view Word doc files online using C# in ASP.NET MVC web applications
asp.net pdf editor component: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
asp.net mvc image viewer: ASP.NET Image Viewer Control(MVC & WebForms): view, annotate, redact, convert image files in html, JQuery
asp.net view powerpoint: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET
In this page, we mainly talk about Excel to JPEG, PNG and GIF raster images rendering and converting within VB.NET platform. And with this easy-to-use and handy Excel to raster images converter, users are about to deal with following things:
  • Get the comprehensive understanding of this VB.NET Excel to raster images converting application and know the necessities of converting Excel to images
  • The precise and free demo APIs on rendering and converting Excel to raster images within VB.NET project
  • The corresponding sample codes on converting Excel document into GIF, PNG or JPEG format in VB.NET class
  • The priorities of this .NET Excel Converting SDK for VB.NET
Conversion Explanations
This VB.NET Excel document to raster images rendering and converting application is a reliable and robust file format converter. It not only can convert Excel to raster image files also can render Excel to vector image - SVG as well as PDF document and so on so forth.
As for Excel to raster images, commonly used JPEG, GIF, PNG and BMP are available. You can batch convert Excel spreadsheets to these image formats at a time. What's more, the image rendering function of this Excel converting toolkit can be fully used to set and customize the rendered image width and height in several times until to the best displaying status with 100% compatible VB.NET example methods and demo codes.

Conversion Necessities

As we know, to keep a document from being freely uploaded, edited or printed, password-protection can be a good solution. However, unlike PDF, Excel document can't set a password against these operations, so, it is indispensable for users to convert Excel to images, then others can handle your Excel document freely without affecting its content.
Demo APIs
If you are a VB.NET user who wants to convert Excel document to raster images by using our Excel to raster images transforming control, you may need to finish an intermediary step, that is, selecting and rendering the target Excel page(s) that need(s) to be converted into our specific REImage. Please see following sample APIs and methods that can be compatible with VB.NET, C#.NET, ASP.NET or .NET WinForms application.
Private Function GetPage(pageIndex As Integer) As BasePage Implements XLSXDocument.GetPage
End Function
Private Function toImage() As BaseImage Implements XLSXPage.toImage
End Function
Private Function toImage(height As Integer, width As Integer) As BaseImage Implements XLSXPage.toImage
End Function
Private Sub SaveImageFile(image As REImage, filePath As [String]) Implements REFile.SaveImageFile
End Sub
Notices on above APIs and methods:
  • "GetPage": allows you to input and choose single or batch Excel pages in VB.NET program to be rendered to REImage
  • "height As Integer, width As Integer": designed to customize rendered image's size to the best displaying effect by changing the image width and height
  • "SaveImageFile": used to convert and save Excel document into raster image (JPEG, PNG or GIF) files
Example Codes
Check following VB.NET example codes on rendering and converting Excel file to raster images. The default displaying sample VB code is on rendering and transforming Excel to GIF format. If you need the example codes on converting Excel to PNG or JPEG, just click to expand each module.
VB.NET Excel: Render and Convert Excel to GIF
''' <summary>
''' Render Excel Document to GIF Image Format
''' </summary>
''' <param name="ExcelFilePath"> </param>
''' <returns> </returns>
Public Function RenderXLSXDocumentToGIF(ExcelFilePath As [String]) As List(Of Stream)
	' A list of stream which contains image data of the GIF image.
	Dim buffer As New List(Of Stream)()

	Dim doc As New XLSXDocument(ExcelFilePath)
	For i As Integer = 0 To doc.GetPageCount() - 1
		Dim page As XLSXPage = DirectCast(doc.GetPage(i), XLSXPage)
		Dim temp As REImage = DirectCast(page.ToImage(), REImage)
		Dim imageStream As New MemoryStream()
		If temp IsNot Nothing Then
			temp.Convert(imageStream, ImageFormat.Gif)
			buffer.Add(imageStream)
		End If
	Next

	Return buffer
End Function
Demo Code to Convert Single Excel Page to PNG Format
''' <summary>
''' Render Excel Document to PNG Image Format
''' </summary>
''' <param name="ExcelFilePath"> </param>
''' <returns> </returns>
Public Function RenderXLSXDocumentToPNG(ExcelFilePath As [String]) As List(Of Stream)
	' A list of stream which contains image data of the PNG image.
	Dim buffer As New List(Of Stream)()

	Dim doc As New XLSXDocument(ExcelFilePath)
	For i As Integer = 0 To doc.GetPageCount() - 1
		Dim page As XLSXPage = DirectCast(doc.GetPage(i), XLSXPage)
		Dim temp As REImage = DirectCast(page.ToImage(), REImage)
		Dim imageStream As New MemoryStream()
		If temp IsNot Nothing Then
			temp.Convert(imageStream, ImageFormat.Png)
			buffer.Add(imageStream)
		End If
	Next

	Return buffer
End Function
How to Convert Multiple Excel Spreadsheets to JPEG Images
''' <summary>
''' Render Excel Document to JPEG Image Format
''' </summary>
''' <param name="ExcelFilePath"> </param>
''' <returns> </returns>
Public Function RenderXLSXDocumentToJPEG(ExcelFilePath As [String]) As List(Of Stream)
	' A list of stream which contains image data of the JPEG image.
	Dim buffer As New List(Of Stream)()

	Dim doc As New XLSXDocument(ExcelFilePath)
	For i As Integer = 0 To doc.GetPageCount() - 1
		Dim page As XLSXPage = DirectCast(doc.GetPage(i), XLSXPage)
		Dim temp As REImage = DirectCast(page.ToImage(), REImage)
		Dim imageStream As New MemoryStream()
		If temp IsNot Nothing Then
			temp.Convert(imageStream, ImageFormat.Jpeg)
			buffer.Add(imageStream)
		End If
	Next

	Return buffer
End Function

Excel Converter Priorities

100% Well Programmed Demo Codes

RasterEdge VB.NET Excel converting tool offers users the most complete and well programmed demo APIs and VB.NET codes on how to convert Excel to rater images or other document files.

Variable VB.NET Project Modes

This Excel converting application is compatible with both single-threaded and high-efficiency multi-threaded VB.NET projects.

Render Excel to Images and Documents

Our Excel converting library in VB.NET language supports rendering and transforming Excel not only to raster or vector (SVG) images, also to PDF document.

Full Options to Customize Converted Image

Mature methods on setting and customizing converted image file in VB.NET through image size and resolution.


Recommend this to Google+


RasterEdge.com is professional provider of ASP.NET MVC Document Viewer, ASP.NET PDF Viewer, MVC PDF Viewer document, content and imaging solutions, available for ASP.NET AJAX, Silverlight, Windows Forms as well as WPF. We are dedicated to provide powerful & profession imaging controls, PDF document, image to pdf files and components for capturing, viewing, processing, converting, compressing and stroing images, documents and more.

©2000-2017 Raster Edge.com