C#: Online Guide
How To: Word SDK
Preview Document
Home ›› XDoc.Word ›› C# Word: Preview Document

How to C#: Preview Document Content Using XDoc.Word

Overview for How to Use XDoc.Word to preview document content without loading entire document in C# .NET Programming Project

RasterEdge XDoc.Word provide you with APIs to get a thumbnail bitmap of the first page in the word document file. You can be able to get a preview of this word document without loading or processing the entire document in memory. pdf to jpg c#, vb.net print pdf, best pdf library c#, add image to pdf using itextsharp vb.net, vb.net read pdf to text, qr code generator with logo c#. With the SDK, you can preview the document content according to the preview thumbnail by the ways as following.

Related .net document control helps:
asp.net document viewer control: EdgeDoc:ASP.NET Document Viewer C# Control: Open, view, annotate, redact, convert documents online in C#, VB.NET, AS...
asp.net annotate pdf control: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C#
asp.net mvc text file viewer: ASP.NET Text file viewer in MVC, WebForms: Open, view, annotate, convert txt files in C# ASP.NET
asp.net tiff viewer control: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control
asp.net edit pdf page: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C#
asp.net edit pdf text color: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET
asp.net pdf viewer control: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET

C# DLLs for Word File Preview

Add references:











Use corresponding namespaces;

  using RasterEdge.Imaging.Basic;

  using RasterEdge.XDoc.Word;

Get Preview From File

You may get document preview image from an existing Word file in C#.net. c# pdfsharp fill pdf form, c# pdf scale, how to add image in pdf header using itext c#, vb.net pdf open password protected file, vb.net pdf viewer component, vb.net pdf text extract, vb net pdf add pages dynamically.

//  Get document preview from word file
String inputFilePath1 = Program.RootPath + "\\" + "1.docx";
Size size = new Size(200, 200);
Bitmap bmp = DOCXDocument.GetPreviewImage(inputFilePath1, size);
if (bmp == null) throw new Exception("fail to load the document preview");
//  ...

Get Preview From Stream

You may get document preview image from stream object in C#.net. asp.net display image from memorystream, asp net show word document in browser, asp.net pdf preview, how to edit pdf file in asp.net c#, asp.net display tiff images, asp.net pdf viewer disable save, asp.net mvc display pdf.

//  Get document preview from stream object
String inputFilePath1 = Program.RootPath + "\\" + "1.docx";
Stream stream = File.Open(intputFilePath, FileMode.Open);
Size size = new Size(200, 200);
Bitmap bmp = DOCXDocument.GetPreviewImage(stream, size);
if (bmp == null) throw new Exception("fail to load the document preview");
//  ...

Get Preview From Byte Array

You may get document preview image from byte array object in C#.net.

//  Get document preview from byte array object
String inputFilePath = Program.RootPath + "\\" + "1.docx";
Size size = new Size(200, 200);
Stream stream = File.Open(inputFilePath, FileMode.Open);
byte[] array = new byte[stream.Length];
stream.Read(array, 0, array.Length);
Bitmap bmp = DOCXDocument.GetPreviewImage(inputFilePath1);
if (bmp == null) throw new Exception("fail to load the document preview");
//  ...