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

VB.NET Word - Render Word Doc to Raster Images

Convert Word Document into JPEG, PNG, BMP and GIF Images in VB.NET Class

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

When you are searching for a Word docx converting library developed within .NET Framework, specifically speaking, VB.NET application, do you have following requirements for it?
Related .net document control helps:
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 pdf viewer control: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET
asp.net pdf document viewer: ASP.NET PDF Document Viewer in C#: open, display, view, annotate, redact Adobe PDF files online in ASP.NET MVC & WebForm...
asp.net document viewer free: EdgeDoc:ASP.NET Document Viewer C# Control: Open, view, annotate, redact, convert documents online in C#, VB.NET, AS...
asp.net excel view: ASP.NET Excel Viewer in C# Control (MVC & WebForms): view Office Excel document in web browser.
asp.net image viewer jquery: ASP.NET Image Viewer Control(MVC & WebForms): view, annotate, redact, convert image files in html, JQuery
powerpoint viewer asp.net mvc: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET
  • Keep Word transforming and converting procedures controllable in VB.NET by using an intermediary rendering toolkit
  • Able to render and convert Word document into JPEG image in VB.NET that acts as a standard image compression mode
  • Able to render and transform a certain Word page to PNG in VB.NET that is a lossless image compressing format for saving raster image
  • Able to render and convert all the Word document pages to GIF format in VB.NET that owns good reputation for its high capacity LZW compression
  • Able to render and convert Word document to Bitmap in VB.NET that is the default image format for Windows image and document management system
If so, you will need this VB.NET Word to Raster Images Converting Component of RasterEdge .NET Imaging SDK, which can fulfill all your above needs in high performance and is featured on user-friendly operating interface, namely, no matter you are technical programmers or sparetime end-users, you are capable of putting it to work with success.
Why Convert Word to Raster Images?
In our daily life, Word document is in a highly accessible state on viewing and reprocessing. If there are some contents in Word need to be encrypted, then it is necessary to convert Word to raster images, like JPEG, to protect the information, as JPEG image is difficult to alter and can be viewed virtually by anyone.
By using RasterEdge Word to raster images converting toolkit in VB.NET program, users are allowed to render and convert all Word pages or a specific single page to raster image(s) at one time. Besides, with the remarkable support of RasterEdge .NET Imaging SDK, users are able to process and set the image size and color depth for the output raster image file.
How to Convert Word File to Raster Images in VB.NET?
When you are going to apply this Word to raster images converter, you may implement "RasterEdge.Imaging.Basic.dll" and "RasterEdge.Imaging.MSWordDocx.dll" assemblies to your VB.NET Word converting application. And please note that, to ensure this Word to raster images converting library work correctly, you need to integrate it within .NET Framework 2.0 (or later versions) and Visual Studio 2005 (or great versions).

VB.NET APIs on Converting Word File to Raster Images

Here is a brief explanation for VB.NET Word document to raster images converting APIs and methods. First, these demo APIs are totally compatible with VB.NET programming class; second, as you can analyze from the methods, users who adopt this Word converter are supposed to render all the Word document or just specific page to REImage before you can convert the rendered Word page image to the supportable raster image files.
''' Render Word document to get a REImage collection, or choose a specific Word page to render
Private Sub New(imgs As List(Of REImage))
End Sub
Private Function GetPage(pageIndex As Integer) As BasePage Implements DOCXDocument.GetPage
End Function
Private Function toImage() As BaseImage Implements DOCXPage.toImage
End Function
Private Function toImage(width As Integer, height As Integer) As BaseImage Implements DOCXPage.toImage
End Function

''' Convert rendered REImage into other raster image formats using image converting API
Private Sub Convert(s As Stream, format As ImageFormat) Implements REImage.Convert
End Sub
Notes on above APIs & methods:
  • "GetPage": used to load and get all the Word document pages or a certain one from the source Word file in Visual Basic programming
  • "width As Integer, height As Integer": can be called and written for setting the rendered image size, including width & height based on individual requirements
  • "Convert": programmed to convert the rendered REImage to JPEG, PNG, GIF or BMP raster image format in Visual Basic programming
Sample Codes in VB on Converting Word to Raster Images
Please refer to following respective Visual Basic demo code for converting Word document to BMP, GIF, JPEG or PNG raster image within VB.NET Word transforming application. You can click to expand each corresponding demo code module.
Convert Word File to BMP Format in VB.NET Class
''' <summary>
''' Render Word document to images of BMP format
''' </summary>
''' <param name="WordFilePath"></param>
''' <returns></returns>
Public Function RenderDOCXDocumentToBMP(WordFilePath As [String]) As List(Of Stream)

	' A list of stream which contains the image data  of the BMP image.
	Dim buffer As New List(Of Stream)()

	Dim doc As New DOCXDocument(WordFilePath)
	For i As Integer = 0 To doc.GetPageCount() - 1
		Dim page As DOCXPage = DirectCast(doc.GetPage(i), DOCXPage)

		Dim temp As REImage = DirectCast(page.ToImage(), REImage)
		Dim imageStream As New MemoryStream()
		If temp IsNot Nothing Then
			temp.Convert(imageStream, ImageFormat.Bitmap)
			buffer.Add(imageStream)

		End If
	Next
	Return buffer

End Function
Render and Convert Word to GIF Image in VB.NET Code
''' <summary>
''' Convert Word document to GIF format
''' </summary>
''' <param name="WordFilePath"></param>
''' <returns></returns>
Public Function RenderDOCXDocumentToGIF(WordFilePath As [String]) As List(Of Stream)

	' A list of stream which contains the image data  of the GIF image.
	Dim buffer As New List(Of Stream)()

	Dim doc As New DOCXDocument(WordFilePath)
	For i As Integer = 0 To doc.GetPageCount() - 1
		Dim page As DOCXPage = DirectCast(doc.GetPage(i), DOCXPage)

		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
Render and Transform Word to JPEG File by Using Demo Code below
''' <summary>
''' Convert Word document to JPEG format
''' </summary>
''' <param name="WordFilePath"></param>
''' <returns></returns>
Public Function RenderDOCXDocumentToGIF(WordFilePath As [String]) As List(Of Stream)

	' A list of stream which contains the image data  of the GIF image.
	Dim buffer As New List(Of Stream)()

	Dim doc As New DOCXDocument(WordFilePath)
	For i As Integer = 0 To doc.GetPageCount() - 1
		Dim page As DOCXPage = DirectCast(doc.GetPage(i), DOCXPage)

		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
VB.NET Code to Convert Word to PNG Image
''' <summary>
''' Convert Word document to PNG format
''' </summary>
''' <param name="WordFilePath"></param>
''' <returns></returns>
Public Function RenderDOCXDocumentToGIF(WordFilePath As [String]) As List(Of Stream)

	' A list of stream which contains the image data  of the GIF image.
	Dim buffer As New List(Of Stream)()

	Dim doc As New DOCXDocument(WordFilePath)
	For i As Integer = 0 To doc.GetPageCount() - 1
		Dim page As DOCXPage = DirectCast(doc.GetPage(i), DOCXPage)

		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


More Word Document Conversion Guide



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