简体   繁体   English

我如何在Office Word 2013中打开.pdf文件(在C#中)并将其另存为.docx(在C#中的代码)?

[英]how can i open .pdf file in office word 2013(in c#) and save as it in .docx (code in c#)?

我想用C#代码打开Pdf文件,我想将Office Word 2013( Microsoft.Office.Interop.Word )与c#一起使用,并另存为c#中的word文件,怎么办?

Give the guy a break, it is his first question and he has actually created an account with a picture an everything so I genuinely believe he is here to learn. 休息一下,这是他的第一个问题,他实际上已经创建了一个带有图片的帐户,包含所有内容,因此我真正相信他是在这里学习。

I have just done a quick google and it looks as though there is no native support for this, I would suggest you search for a an api to do it. 我刚刚做了一个快速的谷歌,它似乎没有对此的本地支持,我建议您搜索一个api来做到这一点。 I found this one which gave you code but I have no idea if it is a good framework or not, the code sample they give is a little over complicated imo. 我发现这个代码为您提供了代码,但我不知道它是否是一个好的框架,他们提供的代码示例有点复杂。

http://www.yiigo.com/guides/csharp/how-to-pdf-convert-word.shtml http://www.yiigo.com/guides/csharp/how-to-pdf-convert-word.shtml

If you are genuine then Good Luck. 如果您是真实的,那么祝您好运。 I would recommend looking at the way other people post questions in the future, there are a lot of people on here who help people out and sometimes it is hard to sift through all of the questions where it looks like the asker is wanting people to solve their problems because they can't be bothered. 我建议您看看将来其他人发布问题的方式,这里有很多人在帮助别人,有时候很难筛选所有问题,就像问问者希望人们解决的一样他们的问题,因为他们不会被打扰。

` `

Wrdapp= new Word.Application();

FileConverter converter=Wrdapp.FileConverters[5];

//For checking format name
converter.FormatName;

Wrdapp.Open("PDF file path",Format:converter.OpenFormat);`

The file will be converted if the converters are installed with office 2013 and above 如果转换器与Office 2013及更高版本一起安装,则将转换文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM