Free Support Forum - aspose.com

I want all browser support to show different file format in a common control(like IFRAME or any other control)

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.





Hi Hema,


Thanks for your feedback.

I have observed the sample code shared by you. I have seen that you are exporting presentation to PDF and then using Aspose.Pdf to export to desired html for display. I believe that your requirement might lie on Aspose.Pdf end and I will request my fellow team member to assisit you further in this regard.

However, i request you to kindly provide a sample presentation, generated PDF and HTMl file for further investigation by my fellow team member.

I also like to add that we have introduced support for exporting PPTX presentations to HTML in previous product release. You can also try the mentioned feature. Please visit this documentaion link for your kind reference.

Many Thanks,

Hi Hema,


I am a representative from Aspose.Pdf team. I have gone through your requirement and as per my understanding, you are facing issue while loading and displaying word documents, and from the code snippet which you have shared, I can see that you are trying to convert PDF files to HTML, Word documents to HTML and PowerPoint presentations to PDF format and then rendering them to HTML format so that the HTML output can be displayed in IFrame. Can you please share that you are only facing the issue while rendering DOC/DOCX files to HTML and during their display or you have been facing issue with all file formats etc.

Furthermore, please note that our sister company GroupDocs.com offers a viewer app which you may consider including in your application to view the various file formats.

We are sorry for your inconvenience.

Hi Hema,


Thanks for your inquiry.

I am a representative from Aspose.Words team. Could you please attach your input Word document here for testing? I will investigate the issue on my side and provide you more information.