How can I view a PowerPoint in an ASP.NET application? - asp.net-mvc-2

Does anyone have a PowerPoint viewer which I can embed in an ASP.NET Web App?

If you are using Silverlight you can use
http://pptx2silverlight.codeplex.com/

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.

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.

Related

How to get html of EPUB by page in flutter?

I want to get the HTML content of an epub file by page. I tried epubx package but it's not working correctly. Has anyone managed to get HTML of an epub by page?
Try this package epub_parser
You can fetch html like the following
// Enumerating chapters
epubBook.Chapters.forEach((EpubChapter chapter) {
// HTML content of current chapter
String chapterHtmlContent = chapter.HtmlContent;
});

Pdf viewer on Smartface

I show pdf with webview but, when pdf shows application goes to back and browser shows pdf url. I do not want to application goes to background. Is this possible to open and view pdf document on Smartface?
I tried this;
this.WebView1.openLinkInside = true;
this.WebView1.URL = "http://adadasd.com/adsad.pdf";
it will be supported version 4.3 gonna be released 2nd week of Feb.
You can check the roadmap.
http://www.smartface.io/roadmap/
General > Blob support

Inserting and Displaying images within the TinyMCE content editor in PHP site

I am currently using tinyMCE to edit content within my site and I am looking for a way display an image within the tinyMCE once it has been uploaded to the site.
Note: I am not looking for a means to upload an image directly into tinyMCE. I am looking for the tinyMCE command which would allow me to display an image within the content in the editor after I have uploaded it.
Thanks
You could insert a regular img-tag inside tinymce using a custom plugin or using the setup parameter in your tinymce init. The src should refer to the html location of the image to be uploaded. As soon as the image is available the image will become visible on next reload of the editors content. If you need further assistance feel free to ask.
After successfull uploaded you have the source of the image (img_src). Now you need to add it to the editor like this
tinymce.activeEditor.insertContent('<img alt="photo" src="' + img_src + '"/>');

Programmatically Generate PDF from HTML on iPhone

I am looking for a way to programmatically (in obj-c) generate a PDF file from a local html file. I am dynamically generating the html from user inputs, I need to create the PDF and send it to the user (via email). I am having difficulty with the PDF generation portion.
I have the code to create a PDF using CGPDFContextCreateWithURL but I am struggling with drawing the page using quartz.
I have searched extensively on SO as well as the internet to no avail.
Any help is much appreciated!
To generate a pdf from an HTML, you need to render the html into a web view, and take snapshots of the web view, and render them into an image context.
The tutorial might be helpful:
http://www.ioslearner.com/convert-html-uiwebview-pdf-iphone-ipad/
I've written a little piece of code that takes an NSAttributedString from DTCoreText, and renders it into a paged PDF file. You can find it on my GitHub Repository. It won't render images or complex html, but it should serve for most uses. Plus, if you're familiar with CoreText, you can extend my PDF frame setter to generate these items.
So what it does now: Give it an HTML string, and it will use DTCoreText to generate an NSAttributedString, then render that into a PDF. It hands back the location that it saved the PDF file in the app's Documents folder.
Why not use a WebService, send the HTML page to this and retrieve the PDF-file ?
That way you can use iTextSharp and C#, and you're done in about 2 minutes.
Plus (if you're evil) you can store and see all the data on your server.
I haven't tried this myself so i have nothing to offer concrete but I'd have to imagine there has to be an easy way to do this on iPhone due to the imaging model. I'd look deeper into the documentation.
As to pushing back with the client that is up to you but there are probably multiple reasons for wanting to keep everything local. Frankly I would not be pleased at all to here from somebody I hired that he couldn't manage this particular task. So think long and hard about this push back. Oh even if you do push back a webserver is a poor choice. I'd go back a step further and investgate why you need something in HTML in the first place.
I've never tried this so I have no idea if it'll work, but how about loading the HTML into a UIWebView, and then make the view draw itself into a PDF context? E.g.
UIWebView *webview = [[UIWebView alloc] initWithFrame:CGRectMake(...)];
[webview loadHTMLString:html baseURL:...];
Then:
- (void)webViewDidFinishLoad:(UIWebView *)webview {
CGPDFContextRef pdfContext = CGPDFContextCreateWithURL(...);
[webview.layer drawInContext:pdfContext];
...
}
I made it by following this SO: https://stackoverflow.com/a/13342906/448717
In order to maintain the same content's proportions I had to multiply the size of the WKWebView 1.25 times the printableRect's size set for the UIPrinterRenderer, as the screen points differs from the PostScript's... I guess.

How to use the iPhone's built-in PDF viewer to display a document

I would like to create an application that downloads a PDF document from the Internet, and displays it to the user. I would like to re-use the iPhone's builtin PDF viewer that is used throughout the core apps to view a PDF document.
Is there a way to do that?
You could just use UIWebView class to do that.
Try this: https://github.com/vfr/Reader