62,074
社区成员
发帖
与我相关
我的任务
分享
protected void pdfToSwf(string filePath)
{
try
{
//切记,使用pdf2swf.exe 打开的文件名之间不能有空格,否则会失败
string cmdStr = Server.MapPath("~/SWFTools/pdf2swf.exe");
//string savePath = Server.MapPath("~/TestSWF/");
string sourcePath = filePath;
string targetPath = filePath.Replace(".pdf", ".swf");
//@"""" 四个双引号得到一个双引号,如果你所存放的文件所在文件夹名有空格的话,要在文件名的路径前后加上双引号,才能够成功
// -t 源文件的路径
// -s 参数化(也就是为pdf2swf.exe 执行添加一些窗外的参数(可省略))
string argsStr = " -t " + sourcePath + " -s flashversion=9 -o " + targetPath;
ExcutedCmd(cmdStr, argsStr);
swfUrl = "Uploads/image/" + System.IO.Path.GetFileName(targetPath);
}
catch
{
}
}
//切记,使用pdf2swf.exe 打开的文件名之间不能有空格,否则会失败