如何在C#中使用Microsoft Office interop将pdf转换为word(,doc)
问题描述:
我想使用Microsoft office interop将我的pdf文件转换为单词,我已经通过网络搜索但我只得到了pdf转换的答案,任何人都有问题的链接请分享我
注意:我只想使用Microsoft办公室互操作而不是任何其他第三方dll
我尝试了什么:
我仍在搜索网络
I want to convert my pdf file to word using Microsoft office interop, i have searched through the net but i got answers for only to pdf conversion,any one have link for the question please share me
note : i want to use only Microsoft office interop not any other 3rd party dll
What I have tried:
still i am searching through the net
答
我用谷歌搜索word自动保存为pdf并找到大量示例,这里是一个;
Office Word文档到PDF转换。 C#中的示例,Visual Studio 2012的VB.NET [ ^ ]
请在提问前做基础研究。另请注意,interop只是一种允许.net组件与COM组件通信的方式(Word是一个COM服务器),运行代码的任何计算机仍然需要安装Word并且作为interop工作只是一种自动化Word的方法.net。
I googled "word automation save as pdf" and found loads of examples, here is one;
Office Word Document to PDF Conversion. sample in C#, VB.NET for Visual Studio 2012[^]
please do basic research before asking a question. Also note that "interop" is simply a way of allowing .net component talk to COM components (Word is a COM server), any computer your code runs on will still need Word installed and working as interop is just a way of automating Word from .net.
如果您不想使用任何第三方库,那么您需要从Adobe获取PDF规范的副本并编写自己的PDF阅读器。另外,请查看 iTextSharp,一个.NET PDF库。 SourceForge.net [ ^ ]。
If you do not want to use any 3rd party library then you need to get a copy of the PDF specification from Adobe and write your own PDF reader. Alternatively take a look at iTextSharp, a .NET PDF library | SourceForge.net[^].