【问题标题】:word automation save as pdfword自动另存为pdf
【发布时间】:2012-05-22 18:59:22
【问题描述】:

在 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);

【问题讨论】:

    标签: pdf converter doc word-automation


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-04-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-17
      相关资源
      最近更新 更多