Aspose Office (excel,word,ppt), PDF online preview

Source: Internet
Author: User

is to make a backup, take a trial version of the Aspose

  1. // <summary>
  2. ///Aspose Office (excel,word,ppt), PDF online preview
  3. // </summary>
  4. /// <param name= "SourceDoc" > File address to preview </param>
  5. /// <param name= "Savedoc" > Display HTML file address </param>
  6. Public void Goto (string sourcedoc, string savedoc)
  7. {
  8. string S_sourcedoc = Server.MapPath (SourceDoc);
  9. string S_savedoc = Server.MapPath (Savedoc);
  10. string docextendname = Path.getextension (S_sourcedoc). ToLower ();
  11. Switch (Docextendname)
  12. {
  13. Case ". Doc":
  14. Case ". docx":
  15. Aspose.Words.Document doc = new Aspose.Words.Document (S_sourcedoc);
  16. Doc. Save (S_savedoc, Aspose.Words.SaveFormat.Html);
  17. Response.Redirect (Savedoc);
  18. break;
  19. Case ". xls":
  20. Case ". xlsx":
  21. Aspose.Cells.Workbook Workbook = new Aspose.Cells.Workbook (S_sourcedoc);
  22. Workbook. Save (S_savedoc, Aspose.Cells.SaveFormat.Html);
  23. Response.Redirect (Savedoc);
  24. break;
  25. Case ". ppt":
  26. Case ". pptx":
  27. Aspose.Slides.Pptx.PresentationEx pres = new Aspose.Slides.Pptx.PresentationEx (S_sourcedoc);
  28. Pres. Save (S_savedoc, Aspose.Slides.Export.SaveFormat.Html);
  29. Response.Redirect (Savedoc);
  30. break;
  31. Case ". pdf":
  32. Aspose.Pdf.Document PDF = new Aspose.Pdf.Document (S_sourcedoc);
  33. Pdf. Save (S_savedoc, Aspose.Pdf.SaveFormat.Html);
  34. Response.Redirect (Savedoc);
  35. break;
  36. }
  37. }

http://download.csdn.net/detail/hou3125378/9909973

Aspose Office (excel,word,ppt), PDF online preview

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.