1、word另存为pdf格式发现缺少表格线
解决:点击单元格 右键 ==》表格属性 ==》边框和底纹 ==》选择除自定义以外的边框
string targetDir = Server.MapPath(“/Template”);
Dictionary<string, Object> replaceList = new Dictionary<string, Object>();
replaceList.Add(“{A}”, 值);
//获取导出目录(无则创建)
string ExportDirPath = Server.MapPath(“”);
string ExportDir = ExportDirPath ;
if (!Directory.Exists(ExportDir))
{
Directory.CreateDirectory(ExportDir);
}
//设置导出文件名称
string TargetFileName_01 = @”/文件名” + DateTime.Now.ToString(“yyyyMMddHHmmss”) + “.docx”;
WordSaveToPDF.ReplaceWordDocAndSave(templatefile01, ExportDir + TargetFileName_01, replaceList);
//转换Excel为pdf 另存为
string TargetFileName_pdf = TargetFileName_01.Replace(“.docx”, “.pdf”);
WordSaveToPDF.WordToPDF(ExportDir + TargetFileName_01, ExportDir + TargetFileName_pdf);