你好,在使用Aspose.Words(v25.1.0)将Word文件转为Pdf时,在保存前执行了邮件合并操作后,公式内容显示不正常了。
源文件:
公式问题.docx (12.2 KB)
正常的效果:
异常的效果:
正常效果使用代码:
Document doc = new Document(@"C:\Users\AKSO-HG\Downloads\公式问题.docx");
string pdfFilePath = @"C:\Users\AKSO-HG\Downloads\公式问题.pdf";
PdfSaveOptions saveOption = new PdfSaveOptions();
saveOption.SaveFormat = SaveFormat.Pdf;
doc.Save(pdfFilePath, saveOption);
异常效果使用代码:
Document doc = new Document(@"C:\Users\AKSO-HG\Downloads\公式问题.docx");
string pdfFilePath = @"C:\Users\AKSO-HG\Downloads\公式问题.pdf";
PdfSaveOptions saveOption = new PdfSaveOptions();
saveOption.SaveFormat = SaveFormat.Pdf;
var keys = new string[] { "A" };
var vals = new string[] { "B" };
doc.MailMerge.Execute(keys, vals);
doc.Save(pdfFilePath, saveOption);