日期:2014-05-18  浏览次数:20961 次

C# Word to PDF问题
问一下有没有用在asp.net中的Word转 PDF插件。

一般Word转PDF有哪些方法?

------解决方案--------------------
C# code

public static void TransformFile(string filepath){
string fppath = System.Configuration.ConfigurationManager.AppSettings["Flashpaper"];
string outpath = filepath.Substring(0, filepath.LastIndexOf('.')) + ".pdf";
string param = fppath + " " + filepath + " -o " + outpath;
Process p = new Process();
p.StartInfo.FileName = "C:\\WINDOWS\\system32\\cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
//p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
try
{
p.Start();
string strOutput = null;
p.StandardInput.WriteLine(param);
p.StandardInput.WriteLine("exit");
strOutput = p.StandardOutput.ReadToEnd();
Console.WriteLine(strOutput);
p.WaitForExit();
p.Close();
}
catch (Exception ex)
{
throw ex;
}
}

------解决方案--------------------
http://www.sautinsoft.com/convert-rtf-html-doc-docx-xls-xlsx-ppt-to-pdf-net-library/overview.php
------解决方案--------------------
http://www.west263.com/info/html/wangluobiancheng/DotNetBianCheng/20080222/8523_2.html
------解决方案--------------------
你可以下载一个比如:CutePDF之类的转换器。再用PDF打印就可以。
------解决方案--------------------
OpenOffice或者Office 2007都可以转化的
------解决方案--------------------
一般都是安装PDF pro后直接打印成PDF