【转】asp仿百度文库、豆丁doc转换(flashpaper)
|
|
asp仿百度文库、豆丁doc转换(flashpaper)环境: flashpaper2.2版 win2008 IIS7 步骤: 1.文件夹权限改为everyone完全控制,虚拟主机应用程序池为Classic那个 2.安装flashpaper2.2版,安装好后会出现一个虚拟打印机Macromedia FlashPaper 3.安装office2007,adobe reader 4.在cmd命令下测试看能否转化文件 D:\Wwwroot\OnlinePaper\FlashPaper2.2\FlashPrinter.exe D:\Wwwroot\OnlinePaper\plan.doc -o D:\Wwwroot\OnlinePaper\plan.swf 如果测试生成了plan.swf则环境已经搭建好了 5.写测试asp代码 FlashPaperPath=Server.mappath("\FlashPaper2.2\FlashPrinter.exe") strUrls = Server.mappath("\1.doc") toswf = Server.mappath("\1.swf") 'response.write FlashPaperPath Set WshShell = server.CreateObject("Wscript.Shell") IsSuccess = WshShell.Run (FlashPaperPath+" "+strUrls+" -o "+toswf,1,true) Response.write IsSuccess if IsSuccess = 0 Then Response.Charset="GBK" Response.write " 命令成功执行!" else Response.Charset="GBK" Response.write " 命令执行失败!权限不够或者该程序无法运行" end if |
仿上面做的修改,但未做测试
protected void Page_Load(object sender, EventArgs e)
{
FlashPaperPath = Server.mappath(@"\FlashPaper2.2\FlashPrinter.exe");
strUrls = Server.mappath(@"\1.doc");
toswf = Server.mappath(@"\1.swf");
//'response.write FlashPaperPath
Set WshShell = server.CreateObject("Wscript.Shell");
IsSuccess = WshShell.Run(FlashPaperPath + " " + strUrls + " -o " + toswf, 1, true);
Response.Write(IsSuccess);
if (IsSuccess = 0)
{
Response.Charset = "GBK";
Response.write("命令成功执行!");
}
else
{
Response.Charset = "GBK";
Response.write("命令执行失败!权限不够或者该程序无法运行");
}
}