Guide for VB.NET
Core Document Formats
Excel to SVG
Additional Features

VB.NET Excel - Convert Excel to SVG

VB.NET Guide for Converting Microsoft Excel to SVG Image

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

Sometimes, we may want to convert certain Excel worksheet into an image, like SVG. What is the easiest way of converting Excel page (sheet) to SVG in VB.NET application? Our .NET Excel Converting Library offers the easiest solution for Excel to SVG image conversion in VB.NET programming. And we provide a guide page here, from which you are able to find answers to all of the following questions.
Related .net document control helps:
asp.net view tiff images: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control
asp.net pdf document viewer c#: ASP.NET PDF Document Viewer in C#: open, display, view, annotate, redact Adobe PDF files online in ASP.NET MVC & WebForm...
c# asp.net dicom viewer: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
asp.net sharepoint document viewer open source: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
asp.net document viewer open source: EdgeDoc:ASP.NET Document Viewer C# Control: Open, view, annotate, redact, convert documents online in C#, VB.NET, AS...
c# asp.net image viewer: ASP.NET Image Viewer Control(MVC & WebForms): view, annotate, redact, convert image files in html, JQuery
asp.net edit pdf image using c#: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C#
  • What APIs should be used to convert Excel sheet to SVG image format in VB.NET programming?
  • To convert Microsoft Excel worksheet to SVG image, what VB.NET codes can be used?
  • What makes VB.NET developers choose our product to convert Excel sheet to SVG image?
Before going to the following parts to find answers to the above questions on Excel to SVG conversion in VB.NET application, you may browse a brief introduction of SVG image format on this paragraph. SVG (short for Scalable Vector Graphics) is an XML-based vector image format which supports three types of graphic objects: vector graphics, raster graphics and text. Generally, lossless data compression algorithms are used for SVG image compression because many repeated fragments of text are contained in SVG image.
APIs Used to Convert Excel to SVG
Users are able to use our VB.NET Excel Converting SDK to convert target Excel worksheet to SVG image in VB.NET program built in Visual Studio 2005 or later versions. You just need to add "RasterEdge.Imaging.Basic.dll" & "RasterEdge.Imaging.MSExcel.dll" two DLLs to your project references. As our SDK does not support directly converting Excel to SVG in VB.NET, target Excel worksheet is rendered to an intermediary (REImage) at first, then the REImage is converted to SVG image format. Therefore, both APIs for rendering Excel to REImage and APIs for converting REImage to SVG are required.
Developers can use the following APIs in your VB.NET project to render Excel worksheet to REImage. Please pay attention that we use XLSXPage to represent one worksheet in an Excel document in our program. And XLSXDocument is an abstraction of the Excel document which includes all documentation properties and spreadsheets of the Excel document.
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
APIs below can be used to convert the REImage rendered from specific Excel worksheet to SVG image format in VB.NET programming.
Private Sub SaveImageFile(image As REImage, filePath As [String]) Implements REFile.SaveImageFile
End Sub
VB.NET Codes to Convert Excel to SVG
We also offer VB.NET sample codes for developers to convert Microsoft Excel worksheet to SVG vector image.

VB.NET Code Used to Render Excel Sheet to REImage

''' <summary>
''' Render XLSXDocument to REImage with XLSXDocument and XLSXPage
''' </summary>
''' <param name="ExcelFilePath"></param>
''' <returns></returns>
Public Function RenderXLSXDocumentToREImage(ExcelFilePath As [String]) As List(Of REImage)
Dim buffer As New List(Of REImage)()
Dim doc As New XLSXDocument(ExcelFilePath)
For i As Integer = 0 To doc.GetPageCount() - 1
' Need to convert BasePage to XLSXPage
Dim page As XLSXPage = DirectCast(doc.GetPage(i), XLSXPage)
Dim temp As REImage = DirectCast(page.ToImage(), REImage)
If temp IsNot Nothing Then
buffer.Add(temp)
End If
Next

Return buffer

End Function
In the above VB.NET sample code, RenderXLSXDocumentToREImage method is used to render Excel document to REImage which is an image class defined by RasterEdge imaging product. And GetPage method is used to specify target Excel worksheet to be converted.

VB.NET Code Used to Convert REImage to SVG

''' <summary>
''' Render Excel document to images of SVG format
''' </summary>
''' <param name="ExcelFilePath"></param>
''' <returns></returns>
Public Function RenderXLSXDocumentToSVG(ExcelFilePath As [String]) As List(Of Stream)
' a list of stream which contains the image data of the SVG 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.Svg)
buffer.Add(imageStream)
End If
Next

Return buffer

End Function
When converting and saving the rendered REImage to other image formats in VB.NET project with our VB.NET Excel Converting SDK, you may use ImageFormat method to specify the image format. In this VB.NET code, you can see Svg image format is chosen. Note: the chosen format should be consistent. For example, if Svg image format is selected, RenderXLSXDocumentToSVG method will be used.
Reasons for Choosing Our Product
Our VB.NET Excel Converting SDK is chosen by many developers to convert Excel sheet to SVG image format may due to three main reasons.

The First Reason: Free to Test

The first reason is that we offer a free trial version of this VB.NET Excel Converting SDK online for developers to convert Excel sheet to SVG image before purchasing.

The Second Reason: Versions Support

The second reason is that VB.NET Excel Converting SDK allows for converting Excel documents of commonly used versions to SVG image. The supported Excel versions are Excel 2007 and above versions.

The Third Reason: More Formats Support

The third reason of selecting our product to convert Excel sheet to SVG format is that this VB.NET Excel Converting SDK also supports converting Excel document to other image and document formats. For instance, you can convert Excel to PDF and render Excel to other raster images (like GIF, PNG and JPEG).


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