且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用ASP.NET C#将word文件(docx)转换为pdf

更新时间:2023-02-19 20:22:36

之前一直在问......

如何在C#中将word文档转换为pdf [ ^ ]

将Word文档转换为ASP.NET服务器上的PDF [ ^ ]



试试!
It has been asking before...
How to convert word document to pdf in C#[^]
Convert Word-Documents to PDF on an ASP.NET Server[^]

Try!


一点点搜索引导你此解决方案 [ ^ 。虽然它是一个Java组件,但NuGet带来了在.NET中使用它所需的一切。
A little bit of searching leads you to this solution[^]. While it's a Java component, the NuGet brings in everything you need to get this working in .NET.


嗨。,



请看一下这个链接



如何在C#中将word文档转换为pdf [ ^ ]



Hi.,

Please have a look at this link

How to convert word document to pdf in C#[^]

public Microsoft.Office.Interop.Word.Document wordDocument { get; set; }







Microsoft.Office.Interop.Word.Application appWord = new Microsoft.Office.Interop.Word.Application();
           wordDocument = appWord.Documents.Open(@"C:\Users\Desktop\test.docx");
           wordDocument.ExportAsFixedFormat(@"C:\Users\Desktop\test11.pdf", WdExportFormat.wdExportFormatPDF);





谢谢



Thanks