Guide for C#
Core Document Formats
Windows Forms Viewer
Additional Features

C# PowerPoint - Windows Document Viewer

How to Create .NET WinForms Viewer to View & Manipulate PowerPoint Document

Visual C#
VB.NET
Home > .NET Imaging SDK > C# > PowerPoint: Windows Document Viewer

"This online guide content is Out Dated!
    Please get the latest Create PowerPoint Windows Viewer Developer Guide here.
"

C#.NET WinForms Viewer Control for PowerPoint
The WinViewer Control, RasterEdge.Imaging.WinformsControl.DocumentViewer.dll, is a .NET imaging control used for Windows Forms applications, which offers professional PowerPoint document solutions for C#.NET users and making PowerPoint document viewing, manipulation, annotation and saving an easy task. Please note, PowerPoint 2007 and above versions are supported by our product.
Related .net document control helps:
asp.net edit pdf page: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C#
asp.net image viewer zoom: ASP.NET Image Viewer Control(MVC & WebForms): view, annotate, redact, convert image files in html, JQuery
asp.net ppt viewer: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET
asp.net dicom viewer: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
asp.net excel view: ASP.NET Excel Viewer in C# Control (MVC & WebForms): view Office Excel document in web browser.
sharepoint document viewer: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
asp.net open word document in browser: ASP.NET Office Word Document Viewer: view Word doc files online using C# in ASP.NET MVC web applications
A complete example of WinViewerDemo is included in RasterEdge.DocImageSDK demo projects in download package. This complete example is implementing default RasterEdge style. If you want to create WinViewerDemo with your own style to view PowerPoint document in C#.NET, please see step-by-step tutorial in the package. Blow is a list of general features that can be applied to C#.NET WinForms PowerPoint viewing application.
  • Create high-quality image thumbnails for automatic PowerPoint document navigation in C#.NET WinForms Document Viewer
  • Easy to load PowerPoint document to raster and vector images to view in created Windows Forms Document Viewer
  • Zoom, pan, or select PowerPoint document page with mouse to fit width, height, or both
  • Allow C#.NET users to edit, annotate and save PowerPoint document at fast speed in document viewer
Create C#.NET WinForms Viewer for PowerPoint
This part will guide you to add .NET WinViewer control to your C#.NET PowerPoint viewing project and invoke APIs of this control. In all, it includes three steps as below.
  1. Set up your C#.NET Windows Forms project;
  2. Open PowerPoint document in C#.NET WinForms project from specified path;
  3. Draw specified type annotation on PowerPoint slide/page in document viewer.

Set Up Your C#.NET WinForms Project

  1. In Visual Studio (2005 or above), create a new C#.NET Windows Forms project called WinViewerDemo. If you already have a Windows Forms project, this step can be omitted.
  2. Add WinViewer control in C#.NET project. Right-click on the Toolbox, select "Choose Items...", locate RasterEdge.DocImagSDK(version)\bin in download package, and browse to find and select RasterEdge.Imaging.WinformsControl.DocumentViewer.dll. Then WinViewer control will appear in Toolbox.
  3. Once you do this, you will find a new reference called RasterEdge.Imaging.WinformsControl.DocumentViewer.dll has been added to your C#.NET WinForms project.

Open PowerPoint in C#.NET WinForms Project from Specified Path

There may be other elements on your form, but in the following C#.NET tutorial, we will take a blank form as an example.
  1. Drag the added .NET WinViewer control onto your C#.NET WinForms application to view PowerPoint document;
  2. Now, you only need several lines of Visual C# code to open a PowerPoint document. And the following C# code presents an open file dialog. You can select a PowerPoint file to be loaded into the WinViewer control. If your PowerPoint file format is not supported by WinViewer control, there will prompt a window "cannot open your file".
If you want to try more functions (design Thumbnail, Navigation, Zoom and so on), please refer to Create Windows Viewer Guide.
public void Form1()
{
	InitializeComponent();
	// Set the windows viewer display options.
	ViewerOptions option = new ViewerOptions();
	// Set the windows viewer height and width. This step is necessary, otherwise will crash.
	option.DocViewerWidth = 400;
	option.DocViewerHeight = 400;
	// Show the thumbnail, true or false.
	option.ShowThumb = true;
	// The location of thumbnail, left, right, top or bottom.
	option.ThumbDock = ThumbDock.Left;
	// Set the thumbnail height
	option.ThumbViewerHeight = 1000;
	// Set whether the document viewer is spread as winViewer
	option.SizeByDocViewer = false;
	// Create windows viewer form.
	winViewer = new WinViewer(option);
	winViewer.Height = 800;
	winViewer.Width = 1000;
	// Add the windows viewer to your own form.
	this.panel1.Controls.Add(winViewer);
}
private void OpenFile_Click(object sender, EventArgse)
{
	OpenFileDialog ofd = new OpenFileDialog();
	ofd.Filter = "(*.*)|*.*";
	ofd.Multiselect = false;
	if (ofd.ShowDialog() == DialogResult.OK)
	{
		this.winViewer1.LoadFromFile(ofd.FileName);
	}
}

Draw Specified Annotation on PowerPoint Slide/Page

C#.NET users can call a single method for each kind of annotation that you want to support in your toolbar button's Onclick events. See sample below.
private void HighLight_Click(object sender, EventArgse)
{
this.winViewer1.DrawHighLight();
}

private void Text_Click(object sender, EventArgse)
{
this.winViewer1.DrawText();
}
PowerPoint annotations can be resized, burnt, delete and moved in WinForms document viewer. For instance, C#.NET users can right-click on the created PowerPoint annotation and choose to burn or delete it. In addition, using this WinViewer control, there's necessary for C#.NET users to add some buttons to complete some operations. For example, if you right-click on image thumbnail, there is the option to "Add new page" or "delete page".


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