try
{
ProcessStartInfo processStartInfo = new ProcessStartInfo();
processStartInfo.FileName = sPdfToolPath;
processStartInfo.WorkingDirectory = Path.GetDirectoryName(sPdfToolPath);
processStartInfo.UseShellExecute = false;
processStartInfo.CreateNoWindow = true;
processStartInfo.RedirectStandardInput = true;
processStartInfo.RedirectStandardOutput = true;
processStartInfo.RedirectStandardError = true;
processStartInfo.Arguments = sArgument;
Process p = Process.Start(sPdfToolPath);
p.StartInfo = processStartInfo;
p.Start();
p.WaitForExit();
FileStream fs = new FileStream(sSavePath + "\\" + sFileName, FileMode.Open);
byte[] file = new byte[fs.Length];
fs.Read(file, 0, file.Length);
fs.Close();
}
catch (System.Exception ex)
{
return ex.Message;
}
執行至Process p = Process.Start(sPdfToolPath);這裡時未能轉換為PDF直接閃過,實際沒有轉換成功
uj5u.com熱心網友回復:
明明是要求 html 啊。你獲得一個 html 頁面靜態檔案。uj5u.com熱心網友回復:
你的 sPdfToolPath 地址能得到啥,你用“文本編輯器”打開看看,就明白了。uj5u.com熱心網友回復:
sPdfToolPath 是wkhtmltopdf.exe組件的Path,拿到是執行組件Path轉載請註明出處,本文鏈接:https://www.uj5u.com/net/31266.html
標籤:C#
上一篇:VS編譯命令
