日期:2014-05-17 浏览次数:20818 次
StringBuilder sb = new StringBuilder();
public Form1()
{
InitializeComponent();
string apppath = System.AppDomain.CurrentDomain.BaseDirectory;
string extArguments = "";
string pfdFilePath = apppath + "a.pdf";
string swfFilePath = apppath + "b.swf";
Process process = new Process(); //创建进程对象
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = apppath + "pdf2swf.exe";
startInfo.Arguments = pfdFilePath + " -s flashversion=9 -o " + swfFilePath + extArguments;
startInfo.UseShellExecute = false; //不使用系统外壳程序启动
startInfo.RedirectStandardInput = true; //不重定向输入
startInfo.RedirectStandardOutput = true; //重定向输出
startInfo.CreateNoWindow = true; //不创建窗口
startInfo.RedirectStandardError = true;
process.StartInfo = startInfo;
process.Start();
process.BeginOutputReadLine();
process.OutputDataReceived += new DataReceivedEventHandler(SortOutputHandler);
process.ErrorDataReceived += new DataReceivedEventHandler(SortOutputHandler);
process.WaitForExit();
}
void SortOutputHandler(object sendingProcess, DataReceivedEventArgs outLine)
{
&nbs