Guide for C#
Core Document Formats
HTML5 Web Viewer
Additional Features

C# PowerPoint - Online Web Document Viewer

View, Annotate, Convert and Save PowerPoint in C#.NET Web Document Viewer

Visual C#
VB.NET
Home > .NET Imaging SDK > C# > PowerPoint: Online Document Viewer
If this is your first time to use our DocImageSDK, we strongly suggest you reading How to Start first!

C#.NET Web Doc Viewer for PowerPoint - Overview
RasterEdge provides mature and comprehensive Web Document Viewer Control for C#.NET applications. After integrating this .NET DLL Control and dependencies into your web project, you are entitled to view, annotate, and convert PowerPoint document (2007 or any later version) quickly and easily. Below is the main functions that are supported by created C#.NET Web PowerPoint Document Viewer.
Related .net document control helps:
asp.net mvc display tiff: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control
asp.net edit pdf page control: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C#
asp.net edit pdf image control: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C#
asp.net annotate pdf control: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C#
asp.net dicom web viewer: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
asp.net image viewer jquery: ASP.NET Image Viewer Control(MVC & WebForms): view, annotate, redact, convert image files in html, JQuery
asp.net sharepoint document viewer free: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
  • Based on JavaScript, using latest HTML5 technology
  • Compatible with any modern web browsers, like IE, FireFox, Chrom, Safari, etc.
  • Easy to install C#.NET PowerPoint web viewing control on Windows compatible server, no need for other add-ins in client side
  • Easy to integrate WebViewer DLL into your ASP.NET project as it is fully written in ASP.NET and C#
  • Quick to transform PowerPoint document (2007 or any later version) to images to view, like PNG, JPEG, GIF and SVG
  • Easy to annotate PowerPoint in C#.NET Web Viewer with various shapes and save changes in native file format
  • Support converting and saving web PowerPoint document to PDF and TIFF
Here we provide online web doucment viewer demo for C#.NET users to have a quick evaluation.
How to Create Web Doc Viewer for PowerPoint - C# Guide
This part aims to help C#.NET programmer to create a web application and then add and embed Web PowerPoint Document Viewer into a web page. At the very beginning, please download DocImage SDK for .NET package which RasterEdge.Imaging.WebViewer.dll and necessary dependencies are included. Our .NET Web Document Viewer Control for C# is compatible with Viusal Studio 2005 and above versions. You can used it in .NET Framework 2.0 and all later versions. If you want to see more detailed functions that WebViewer DLL provides, please see developer guide in the download package.

C# Guide: Setup an ASP.NET Website in Visual Studio

  1. Add references to C#.NET PowerPoint viewing project: right-click the project, select "Add Reference..." locate RasterEdge.DocImagSDK(version)\bin in the download package, and add a new reference called RasterEdge.Imaging.WebViewer.dll to your C#.NET project. Once you do this, dependencies will automatically be included in your project.
  2. Modify your configuration file: copy the content of Web.config in the download package to your configuration file which is supposed to be Web.config.
  3. Your C#.NET PowerPoint viewing project will need a copy of .NET Web Document Viewer resources, which includes client side javascript and styles. These resources folder called "RasterEdge_Imaging_Files", "RasterEdge_Demo_Docs" and "RasterEdge_Cache", located in the download package. The WebHandler.ashx file has been included in RasterEdge_Imaging_Files. Copy these directories to the root of your C#.NET web project.

C# Guide: Add Web Document Viewer to ASPX Web Page

In a real deployment, you will want to insert C#.NET Web PowerPoint Document Viewer into your own web page, but for this example we will work with a new page.
  1. Add a new Web Form to your C#.NET web project. We assume that you name this file Default.aspx and Visual Studio will automatically create a code behind for this file, called Default.aspx.cs.
  2. And then, copy the following lines of C# code to the head of Default.aspx. The first three lines of C# code are to load the necessary resources for creating web PowerPoint document viewer objects. And the remaining code is to initialize your web viewer.
<link href="RasterEdge_Imaging_Files/RasterEdge.css" rel="stylesheet"type="text/css"/>
<script src="RasterEdge_Imaging_Files/RasterEdge.js" type="text/javascript"></script>
<script src="RasterEdge_Imaging_Files/CreateViewerToolBar.js" type="text/javascript"></script>
<script type="text/javascript">
_fid = "<%=fid %>";
_viewer = new RasterEdgeViewer({
_serverUrl: "/RasterEdge_Imaging_Files/WebHandler.ashx",
//0 represent png, 1 represent svg
_pdfViewer: 1,
_wordViewer: 1,
_excelViewer:1,

//Set width and height of the webViewer(pixel)
_viewerWidth: 1024,
_viewerHeight: 730,
});

//define annotation style
//annotation style
//Color:Hexadecimal color can be used
//Transparency:1 on behalf of saturated, 0 represents completely transparent
//TextStyle:italic/oblique/normal
TextAnnoStyle = new AnnoStyle({FillColor: "White", ShowedText: "double click to edit", TextColor: "Black", TextFont: "Arial", TextSize: 12, TextStyle :"normal"});
FreehandAnnoStyle = new AnnoStyle({OutLineColor: "Red", OutLineWidth: 5.0});
HighlightAnnoStyle = new AnnoStyle({FillColor: "Yellow"});
RectangleAnnoStyle = new AnnoStyle({OutLineColor: "Black", OutLineWidth: 3.0});
FilledRectangleAnnoStyle = new AnnoStyle({OutLineColor: "Black", OutLineWidth: 3.0, FillColor: "Black", Transparency: 1});
EllipseAnnoStyle = new AnnoStyle({FillColor: "Orange"});
RubberStampAnnoStyle = new AnnoStyle({OutLineColor: "Tomato", OutLineWidth: 3.0, FillColor: "Red", ShowedText: "Good", TextColor: "Black", TextFont: "Arial", TextSize: 12, TextStyle: "Italic"});
PolygonLinesAnnoStyle = new AnnoStyle({OutLineColor: "Red", OutLineWidth: 5.0});
PolygonAnnoStyle = new AnnoStyle({OutLineColor: "OrangeRed", OutLineWidth: 3.0, FillColor: "OrangeRed"});
LineAnnoStyle = new AnnoStyle({OutLineColor: "Red", OutLineWidth: 5.0});
ArrowAnnoStyle = new AnnoStyle({OutLineColor: "Red", OutLineWidth: 5.0, FillColor: "Red",Transparency:0.8});

//Set whether the toolbar shows the corresponding icon(true or false)
//You can set the item including:_toolbar/_fileToolbar/_annoToolbar/_fullToolbar
//_uploadToolbar/_printToolbar/_saveToolbar/_convertToolbar //_textToolbar/_freehandToolbar/_arrowToolbar/_lineToolbar/_polygonLinesToolbar/_filledRectangleToolbar/_rectangleToolbar/_highlightToolbar/_ellipseToolbar/_polygonToolbar/_rubberStampToolbar/_deleteToolbar
</script>
  1. Next, add the following HTML into your PowerPoint document's body to create the document viewing area.
<div class="re_container">
<div class = "re_func_toolbar"></div>
<div id="_tblImgs"class="re_content" style="width:100%">
<div class="RE_WebViewer" id="REWebViewer1"></div>
</div>
</div>
  1. Here are some snippets of Default.aspx. In order to use certain functions, you may select some codes below to Default.aspx.cs file in your C#.NET web PowerPoint viewing project. Two methods, "OpenFile()" and "SaveFile()", allow users to customize the way to open and store PowerPoint files.
public string mode;
public string fid;
protected void Page_Load(object sender, EventArgs e)
{
string command = Request.Form["RECommand"];
if (command == null || command.Equals(""))
{
WorkRegistry.Reset();
LoadFileFromUrl();
}
else if (command.Equals("OpenFile"))
{
LoadFileFromUpload();
}
else if (command.Equals("SaveFile"))
{
SaveFile();
}
}

public void LoadFileFromUrl()
{
string file = Request.QueryString["file"];
if (file != null &&file != "")
{
file = file.Trim();
string initFilePath = file;
string projectName = System.Web.HttpContext.Current.Request.PhysicalApplicationPath.Replace("\\", "/");
string path = projectName + "
/RasterEdge_Demo_Docs/" + initFilePath;
if (File.Exists(path))
{
fid = REDocumentControl.GenerateId();
string result = LoadFile("
RasterEdge_Demo_Docs" + initFilePath, fid);
if (result != "
")
this.RegisterStartupScript("
", "<script>alert('" + result + "');</script>");
}
}
}

public void LoadFileFromUpload()
{
string uploadFile = Request.Form["
uploadfile"];
string filename = "
/RasterEdge_Cache/" + uploadFile;
fid = Request.Form["
Fid"];
string result = LoadFile(filename, fid);
Response.Clear();
Response.Write(result);
Response.End();

//load document from stream
//REDocumentControl.LoadFile(Stream stream, fid);

//load document from array
//REDocumentControl.LoadFile(byte[] array, fid);
}

public void SaveFile()
{
string fileName = Request.Form["
saveFileName"];
string fid = Request.Form["
Fid"];
Response.Clear();
Response.Write(fileName);
Response.End();
}

private string LoadFile(string filename,string fid)
{
string result = "
";
try
{
REDocumentControl.LoadFile(filename, fid);
}
catch (Exceptionex)
{
result = ex.Message.ToString();
}
return result;
In addition to PowerPoint document viewer solution for web application, RasterEdge also enables C#.NET users to create Windows PowerPoint Document Viewer and Mobile PowerPoint Document Viewer.


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