问题
Does anyone have a PowerPoint viewer which I can embed in an ASP.NET Web App?
回答1:
If you are using Silverlight you can use
http://pptx2silverlight.codeplex.com/
回答2:
You can't directly embed a PPT/presentation to view. Instead you can try any converter that allows you to embed the PPT slide as images or some other format that the client browser can render to the user. There are few products like GroupDocs viewer or Doconut viewer that do this. You can give it a try.
回答3:
You will have to convert the PowerPoint slides in the form, i.e. images or HTML pages, that can be embedded in your web page. You may try GroupDocs.Viewer for .NET that allows rendering the presentation slides into high-fidelity images (PNG/JPG) or the HTML pages. You can then embed the rendered pages into your web page to preview the slides. This is how you can render the slides:
Rendering as Image:
using GroupDocs.Viewer.Options;
// Set output path
string OutputPagePathFormat = Path.Combine("C:\\output", "page_{0}.png");
// Render document pages
using (Viewer viewer = new Viewer("C:\\sample.pptx"))
{
PngViewOptions options = new PngViewOptions(OutputPagePathFormat);
viewer.View(options);
// Rendered images will be saved in the D:\output\ directory.
}
Rendering as HTML:
using GroupDocs.Viewer.Options;
// The file path format
string OutputPagePathFormat = Path.Combine("C:\\output","page-{0}.html");
using (Viewer viewer = new Viewer("C:\\sample.pptx"))
{
HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(OutputPagePathFormat);
viewer.View(options);
}
Disclosure: I work as a developer evangelist at GroupDocs.
来源:https://stackoverflow.com/questions/4461620/how-can-i-view-a-powerpoint-in-an-asp-net-application