1

在 MS Word 2010 中将文档另存为 pdf 时,我们会获得其他选项,例如“优化”。这些选项在 c# 中不能设置为 Document.Saveas 函数的参数。请告诉我如何在保存 pdf 之前设置这些选项。

Document doc = word.Documents.Open(ref filename, ref oFalse, ref oTrue, ref oFalse, "?#nonsense@$", "?#nonsense@$", ref oTrue, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oFalse, ref oFalse, WdDocumentDirection.wdLeftToRight, ref oTrue);
doc.Activate();
object outputFileName = wordFile.FullName.Replace(".docx", ".pdf");
object fileFormat = WdSaveFormat.wdFormatPDF;
// Save document into PDF Format
doc.SaveAs(ref outputFileName, ref fileFormat, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oFalse);
4

1 回答 1

2

Document.ExportAsFixedFormat中的 OptimizeFor 参数将满足您的需要

于 2012-05-21T14:32:11.667 回答