大家好,我想把pdf转换成swf文件,就在asp.net后台代码中启动了flashpaper进程,但同样的代码在winxp下,好用。但在win2003下,就不好用了。代码如下:
public static void ConvertPdfToSwf(HttpRequest reqeust, String styFileName, String[] dataFileNames, String outputFileFullName)
{
try
{
String flashPrinter = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "FlashPrinter.exe");//FlashPrinter.exe
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(flashPrinter);
if (String.IsNullOrEmpty(outputFileFullName))
{
return ;
}
Int32 intLastDot = outputFileFullName.LastIndexOf(".");
//*********Temp Programming****************************************
Int32 intLast = outputFileFullName.LastIndexOf("\\");
String path = outputFileFullName.Substring(0, intLast);
String tempFileName = path + "\\PdfToSwf20080923.pdf";
//*****************************************************************
String swfFileName = String.Concat(path, "\\PdfToSwf20080923.swf");
startInfo.Arguments = String.Concat(tempFileName, " -o ", swfFileName);
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo = startInfo;
Boolean isStart = process.Start();
process.WaitForExit();
process.Close();
}
catch(Exception ex)
{
throw ex;
}
public static void ConvertPdfToSwf(HttpRequest reqeust, String styFileName, String[] dataFileNames, String outputFileFullName)
{
try
{
String flashPrinter = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "FlashPrinter.exe");//FlashPrinter.exe
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(flashPrinter);
if (String.IsNullOrEmpty(outputFileFullName))
{
return ;
}
Int32 intLastDot = outputFileFullName.LastIndexOf(".");
//*********Temp Programming****************************************
Int32 intLast = outputFileFullName.LastIndexOf("\\");
String path = outputFileFullName.Substring(0, intLast);
String tempFileName = path + "\\PdfToSwf20080923.pdf";
//*****************************************************************
String swfFileName = String.Concat(path, "\\PdfToSwf20080923.swf");
startInfo.Arguments = String.Concat(tempFileName, " -o ", swfFileName);
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo = startInfo;
Boolean isStart = process.Start();
process.WaitForExit();
process.Close();
}
catch(Exception ex)
{
throw ex;
}
解决方案 »
- Spring.NET的依赖注入
- 波浪线符号后面跟着方法是什么定义?
- asp.net 怎么吧Excell中以0开头的数据,导入到数据库中?
- eWebEditor绑定于datalist的模版中,如何对他操作?
- 有用过Wizard控件的吗?
- 这行为什么会出错!!!
- 我是用了2003服务器,不过我的程序中了水晶报表是不是一定要安装Visual Studio .net 2003
- ********************* cookie是否可以存数组??? *********************
- 做好了一个网站,怎么打包,使可以在别的电脑上安装。在线等!~~~~~~~~~~
- 关于checkboxlist 选值问题(在线等)
- 这程序能坚持多久?
- 能远程连接虚拟主机上的数据库吗?
顺便宣传下我的网站啊
http://www.downgreen.com想弄个截图过来发不过来啊