Word转PDF及SWF在线浏览——Flash Paper - ☀宝宝合凤凰☀
Word转PDF及SWF在线浏览——Flash Paper
2010-11-15 20:49
☀宝宝合凤凰☀
阅读(3413)
评论(4)
编辑
收藏
举报
Flash Paper支持Office文档(.doc,.xls,.ppt)直接转换为PDF或SWF,速度很快,效果较好。可惜,Flash Paper V2.2后没有再更新了。安装Flash Paper后,可以直接使用命令调用FlashPrinter.exe,实现批量转换。
例如:C:\FlashPaper2.2\FlashPrinter.exe C:\Flex技术简介.ppt -o C:\Flex技术简介.pdf
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
//转换office到swf
protected void Button1_Click(object sender, EventArgs e)
{
bool isconvert = ConvertPdfToSwf(“officeroot\\a.doc”, “swfroot\\a1.swf”);
}
/// <summary>
/// 文档转swf
/// </summary>
/// <param name=”inFilename”></param>
/// <param name=”swfFilename”></param>
public bool ConvertPdfToSwf(string inFilename,string swfFilename)
{
bool isStart;
try
{
string flashPrinter = string.Concat(AppDomain.CurrentDomain.BaseDirectory, “flashpaper\\FlashPrinter.exe”);//FlashPrinter.exe
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(flashPrinter);
startInfo.Arguments = string.Concat(Server.MapPath(inFilename), ” -o “, Server.MapPath(swfFilename));
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo = startInfo;
isStart = process.Start();
process.WaitForExit();
process.Close();
}
catch (Exception ex)
{
throw ex;
}
return isStart;
}
}