protected bool WordToPdf(string sourcePath, string targetPath)
{
try
{
//读取doc文档
Aspose.Words.Document doc = new Aspose.Words.Document(sourcePath);
//转换为PDF文件并保存
doc.Save(targetPath, SaveFormat.Pdf);
return true;
}
catch
{
return false;
}
}
多用byte[],少用文件