求.net版将word2007转换成pdf 的控件

qq465999214 2017-09-20 03:18:13
求.net版将word2007转换成pdf 的控件
...全文
381 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq465999214 2017-10-20
  • 打赏
  • 举报
回复
的确可以
引用 5 楼 SpringHgui 的回复:
Aspose.Words操作word生成PDF文档 http://www.cnblogs.com/weixing/p/5564481.html
Jack_Spring 2017-09-22
  • 打赏
  • 举报
回复
如果有,我也想要
SpringHgui 2017-09-21
  • 打赏
  • 举报
回复
Aspose.Words操作word生成PDF文档 http://www.cnblogs.com/weixing/p/5564481.html
ngym2011 2017-09-21
  • 打赏
  • 举报
回复
可以用Aspose.Words

  Document doc = new Document(@"1.doc");
   doc.Save(@"1.pdf", Aspose.Words.SaveFormat.Pdf);
白衣如花 2017-09-20
  • 打赏
  • 举报
回复
正好前几天转过一个html,前提是要安装了office,且其他电脑也要安装相同版本office才能用此程序
        private string WordToHtm(string wordFile)
        {
            ApplicationClass word = new ApplicationClass();

            Document doc = word.Documents.Open(wordFile, true, true);

            string saveFile = wordFile.Substring(0, wordFile.LastIndexOf('.')) + ".htm";

            doc.SaveAs2(saveFile, WdSaveFormat.wdFormatFilteredHTML);

            doc.Close();

            word.Quit();

            return saveFile;
        }
注意到最后一个参数是枚举 doc.SaveAs2(saveFile, WdSaveFormat.wdFormatFilteredHTML); 点进去,果然有PDF
namespace Microsoft.Office.Interop.Word
{
    //
    // 摘要:
    //     Specifies the format to use when saving a document.
    [Guid("6AEEBC10-0420-3FB1-8A04-5F2053C4DAE9")]
    public enum WdSaveFormat
    {
        //
        // 摘要:
        //     Microsoft Word format.
        wdFormatDocument = 0,
        //
        // 摘要:
        //     Microsoft Word 97 document format.
        wdFormatDocument97 = 0,
        //
        // 摘要:
        //     Microsoft Word template format.
        wdFormatTemplate = 1,
        //
        // 摘要:
        //     Word 97 template format.
        wdFormatTemplate97 = 1,
        //
        // 摘要:
        //     Microsoft Windows text format.
        wdFormatText = 2,
        //
        // 摘要:
        //     Microsoft Windows text format with line breaks preserved.
        wdFormatTextLineBreaks = 3,
        //
        // 摘要:
        //     Microsoft DOS text format.
        wdFormatDOSText = 4,
        //
        // 摘要:
        //     Microsoft DOS text with line breaks preserved.
        wdFormatDOSTextLineBreaks = 5,
        //
        // 摘要:
        //     Rich text format (RTF).
        wdFormatRTF = 6,
        //
        // 摘要:
        //     Unicode text format.
        wdFormatUnicodeText = 7,
        //
        // 摘要:
        //     Encoded text format.
        wdFormatEncodedText = 7,
        //
        // 摘要:
        //     Standard HTML format.
        wdFormatHTML = 8,
        //
        // 摘要:
        //     Web archive format.
        wdFormatWebArchive = 9,
        //
        // 摘要:
        //     Filtered HTML format.
        wdFormatFilteredHTML = 10,
        //
        // 摘要:
        //     Extensible Markup Language (XML) format.
        wdFormatXML = 11,
        //
        // 摘要:
        //     XML document format.
        wdFormatXMLDocument = 12,
        //
        // 摘要:
        //     XML template format with macros enabled.
        wdFormatXMLDocumentMacroEnabled = 13,
        //
        // 摘要:
        //     XML template format.
        wdFormatXMLTemplate = 14,
        //
        // 摘要:
        //     XML template format with macros enabled.
        wdFormatXMLTemplateMacroEnabled = 15,
        //
        // 摘要:
        //     Word default document file format. For Microsoft Office Word 2007, this is the
        //     DOCX format.
        wdFormatDocumentDefault = 16,
        //
        // 摘要:
        //     PDF format.
        wdFormatPDF = 17,
        //
        // 摘要:
        //     XPS format.
        wdFormatXPS = 18,
        //
        // 摘要:
        //     Reserved for internal use.
        wdFormatFlatXML = 19,
        //
        // 摘要:
        //     Reserved for internal use.
        wdFormatFlatXMLMacroEnabled = 20,
        //
        // 摘要:
        //     Reserved for internal use.
        wdFormatFlatXMLTemplate = 21,
        //
        // 摘要:
        //     Reserved for internal use.
        wdFormatFlatXMLTemplateMacroEnabled = 22,
        //
        wdFormatOpenDocumentText = 23,
        //
        wdFormatStrictOpenXMLDocument = 24
    }
}
xiaoqiang_gao 2017-09-20
  • 打赏
  • 举报
回复
据了解没有这样的控件

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧