C#: Online Guide
How To: powerpoint SDK
Preview Document
  |  
Home ›› XDoc.PowerPoint ›› C# PowerPoint: Preview Document

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


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




RasterEdge XDoc.PowerPoint provide you with APIs to get a thumbnail bitmap of the first page in the PowerPoint document file. You can be able to get a preview of this PowerPoint document without loading or processing the entire document in memory. 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 office file viewer: ASP.NET Office Word Document Viewer: view MS Office Word files online using C# in ASP.NET web applications
asp.net create pdf control: ASP.NET Create PDF Document Control: create, convert PDF file from Word, Excel, Tiff file formats in C# ASP.NET
asp.net redact pdf control: ASP.NET Redact PDF Document Control: redact, remove PDF text, images in web browser using C# ASP.NET
asp.net mvc pdf editor control: ASP.NET MVC PDF Editor: view, annotate, redact, edit PDF document in C# ASP.NET MVC
asp.net excel file viewer: ASP.NET Excel Document Viewer in C# Control: view office excel files online in ASP.NET web applications
asp.net tiff file viewer: ASP.NET Tiff Document Viewer: view, annotate Tiff files in HTML using C# Control
asp.net sharepoint pdf editor control: ASP.NET SharePoint PDF Editor Control: view, edit, annotate, redact PDF document in SharePoint sites




C# DLLs: Preview PowerPoint Document



Add necessary XDoc.PowerPoint DLL libraries into your created C# application as references.


  RasterEdge.Imaging.Basic.dll


  RasterEdge.XDoc.Office.Inner.Common.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XDoc.Office.Inner.Office03.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.XDoc.PowerPoint.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XImage.Raster.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.PowerPoint;




Get Preview From File



You may get document preview image from an existing PowerPoint file in C#.net.




//  Get document preview from PowerPoint file
String inputFilePath1 = Program.RootPath + "\\" + "1.pptx";
Size size = new Size(200, 200);
Bitmap bmp = PPTXDocument.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.




//  Get document preview from stream object
String inputFilePath1 = Program.RootPath + "\\" + "1.pptx";
Stream stream = File.Open(intputFilePath, FileMode.Open);
Size size = new Size(200, 200);
Bitmap bmp = PPTXDocument.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.pptx";
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 = PPTXDocument.GetPreviewImage(inputFilePath1);
if (bmp == null) throw new Exception("fail to load the document preview");
//  ...