Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Spire.XLS for .NET supports converting Excel worksheets to images.

DZone's Guide to

Spire.XLS for .NET supports converting Excel worksheets to images.

·
Free Resource

 Making a Microsoft Excel worksheet to an image file can be quite useful when you might need to use an image of a worksheet in an application or web page. This can be the most effective solution for developers to convert worksheet to image as this solution converts Excel spreadsheets-including all text, formatting and diagrams-to graphic files.

Steps of converting Excel worksheets to Image
  Step1.Create a new workbook
  Load information from excel file and transfer into workbook
  Save workbook as any image file format at your will

 Step2.Excel to Image

 Download Spire.XLS for .NET (or Spire.Office) with .NET Framework 2.0 (or above) together. In your application add Spire.XLS reference. The following code snippet shows how to convert an Excel worksheet to an image in C#, VB.NET.

C# Convert Excel to Image:

[C#]
01 using Spire.Xls;
02 namespace Xls2Image
03
04 {
05 class Program
06 {
07 static void Main(string[] args)
08 {
09 Workbook workbook = new Workbook();
10 workbook.LoadFromFile(@"..\..\test.xls");
11 Worksheet sheet = workbook.Worksheets[0];
12 sheet.SaveToImage("sample.jpg");
13 }
14 }
15 }

VB.NET Convert Excel to Image:

[Visual Basic]
01 Imports Spire.Xls
02 Namespace Xls2Image
03 Friend Class Program
04 Shared Sub Main(ByVal args() As String)
05 Dim workbook As New Workbook()
06 workbook.LoadFromFile("..\..\test.xls")
07 Dim sheet As Worksheet = workbook.Worksheets(0)
08 sheet.SaveToImage("sample.jpg")
09 End Sub
10 End Class
11 End Namespace
12



 Spire.XLS for .NET supports converting Excel worksheets to images. To use this feature, you need to invocate the method-public void SaveToImage(string fileName) in your program or project. You can convert a worksheet to image file(s) with different attributes or options and you can save the image file to disk. Most image formats are supported, such as BMP, PNG, GIF, JPG, JPEG, TIFF, and etc.

 Spire.XLS for .NET is produced by E-iceblue.E-iceblue Co., Ltd. ,which is a vendor of .NET, Silverlight and WPF development components. The goal of e-iceblue is always to offer high-quality components for reading and writing different formats of office files. Our components have been widely-used by most of the Fortune 500 corporations. The key developers of e-iceblue have over 10 years of combined experience developing high-performance, high-quality .NET, Silverlight and WPF component technology. Everyday, e-iceblue products help a large number of developers from large/small companies in more than sixty countries to easier, better, faster and to be more productive develop and deliver reliable applications to their customers.

More about the function of Spire .XLS, please visit:
http://www.e-iceblue.com/Introduce/excel-for-net-introduce.html



Steps of converting Excel worksheets to Image
    Create a new workbook
    Load information from excel file and transfer into workbook
    Save workbook as any image file format at your will

Excel to Image

 Download Spire.XLS for .NET (or Spire.Office) with .NET Framework 2.0 (or above) together. In your application add Spire.XLS reference. The following code snippet shows how to convert an Excel worksheet to an image in C#, VB.NET.

 
C# Convert Excel to Image:
[C#]
01	using Spire.Xls;
02	namespace Xls2Image
03	 
04	{
05	    class Program
06	    {
07	        static void Main(string[] args)
08	        {
09	            Workbook workbook = new Workbook();
10	            workbook.LoadFromFile(@"..\..\test.xls");
11	            Worksheet sheet = workbook.Worksheets[0];
12	            sheet.SaveToImage("sample.jpg");
13	        }
14	    }
15	}
VB.NET Convert Excel to Image:
[Visual Basic]
01	Imports Spire.Xls
02	Namespace Xls2Image
03	       Friend Class Program
04	              Shared Sub Main(ByVal args() As String)
05	                     Dim workbook As New Workbook()
06	                     workbook.LoadFromFile("..\..\test.xls")
07	                     Dim sheet As Worksheet = workbook.Worksheets(0)
08	                     sheet.SaveToImage("sample.jpg")
09	              End Sub
10	       End Class
11	End Namespace
12	        

 
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}