is to make a backup, take a trial version of the Aspose
- // <summary>
- ///Aspose Office (excel,word,ppt), PDF online preview
- // </summary>
- /// <param name= "SourceDoc" > File address to preview </param>
- /// <param name= "Savedoc" > Display HTML file address </param>
- Public void Goto (string sourcedoc, string savedoc)
- {
- string S_sourcedoc = Server.MapPath (SourceDoc);
- string S_savedoc = Server.MapPath (Savedoc);
- string docextendname = Path.getextension (S_sourcedoc). ToLower ();
- Switch (Docextendname)
- {
- Case ". Doc":
- Case ". docx":
- Aspose.Words.Document doc = new Aspose.Words.Document (S_sourcedoc);
- Doc. Save (S_savedoc, Aspose.Words.SaveFormat.Html);
- Response.Redirect (Savedoc);
- break;
- Case ". xls":
- Case ". xlsx":
- Aspose.Cells.Workbook Workbook = new Aspose.Cells.Workbook (S_sourcedoc);
- Workbook. Save (S_savedoc, Aspose.Cells.SaveFormat.Html);
- Response.Redirect (Savedoc);
- break;
- Case ". ppt":
- Case ". pptx":
- Aspose.Slides.Pptx.PresentationEx pres = new Aspose.Slides.Pptx.PresentationEx (S_sourcedoc);
- Pres. Save (S_savedoc, Aspose.Slides.Export.SaveFormat.Html);
- Response.Redirect (Savedoc);
- break;
- Case ". pdf":
- Aspose.Pdf.Document PDF = new Aspose.Pdf.Document (S_sourcedoc);
- Pdf. Save (S_savedoc, Aspose.Pdf.SaveFormat.Html);
- Response.Redirect (Savedoc);
- break;
- }
- }
http://download.csdn.net/detail/hou3125378/9909973
Aspose Office (excel,word,ppt), PDF online preview