Dear Mudassir Fayyaz ,
Hi Good Morning, Thanks for your reply. My requirement is I want to load the different file formats documents like .doc, .docx, .pdf, .ppt to any controls. So I choose one common control “IFRAME”. I try to load the above file format documents In IFRAME using your different Aspose dlls. But I can't able to load these document to iframe. Some times iframe shows word document in mozilla but not in IE, I want a all browser support . This is my full requirement. Can you tell the proper solution for me . Its very urgent. Do you have any dll to support my requirement. I wants to buy immediately.
This is my source code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using Aspose.Slides;
namespace WebApplication2
{
public partial class UsingPDFToHTML : System.Web.UI.Page
{
string StrGenFile = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
Converted();
aa.Attributes.Add("src", StrGenFile);
}
private void Converted()
{
//string sourceDocumentFileName = "wordDoc.pdf";
//string sourceDocumentFileName = "wordFile.docx";
string sourceDocumentFileName = "powerpoint.ppt";
FileInfo fileInfo = new FileInfo(sourceDocumentFileName);
if (fileInfo.Extension == ".pdf")
{
string DirectoryName = fileInfo.Name.Substring(0, fileInfo.Name.Length - fileInfo.Extension.Length);
Aspose.Pdf.Document pdfdocument = new Aspose.Pdf.Document(Server.MapPath(string.Format("{0}", fileInfo)));
StrGenFile = string.Format("{0}.html", DirectoryName);
pdfdocument.Save((Server.MapPath(string.Format("{0}.html", DirectoryName))), Aspose.Pdf.SaveFormat.Html);
}
else if (fileInfo.Extension == ".docx" | fileInfo.Extension == ".doc")
{
Aspose.Words.Document doc = new Aspose.Words.Document(Server.MapPath(string.Format("{0}", fileInfo)));
string DirectoryName = fileInfo.Name.Substring(0, fileInfo.Name.Length - fileInfo.Extension.Length);
StrGenFile = string.Format("{0}.html", DirectoryName);
doc.Save(Server.MapPath(string.Format("{0}.html", DirectoryName)), Aspose.Words.SaveFormat.Html);
}
else if (fileInfo.Extension == ".ppt")
{
try
{
Aspose.Slides.Presentation pres = new Aspose.Slides.Presentation(Server.MapPath(string.Format("{0}", fileInfo)));
string DirectoryName = fileInfo.Name.Substring(0, fileInfo.Name.Length - fileInfo.Extension.Length);
pres.Save((Server.MapPath(string.Format("{0}.pdf", DirectoryName))), Aspose.Slides.Export.SaveFormat.Pdf);
Aspose.Pdf.Document pdfdocument = new Aspose.Pdf.Document(Server.MapPath(string.Format("{0}.pdf", DirectoryName)));
StrGenFile = string.Format("{0}.html", DirectoryName);
pdfdocument.Save((Server.MapPath(string.Format("{0}.html", DirectoryName))), Aspose.Pdf.SaveFormat.Html);
}
catch
{
}
}
}
}
}
Design:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UsingPDFToHTML.aspx.cs" Inherits="WebApplication2.UsingPDFToHTML" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<iframe id="aa" runat="server" height="1000" width="700">
</iframe>
</div>
</form>
</body>
</html>
This requirement has to be implemented in my live project. Can you tell the proper solution for me as soon as possible.