如何将.pdf转化为word文档!!!

xjaifly 2003-09-03 04:16:34
请问在C#中如何写将.pdf转化为word文档的程序!!!
...全文
59 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
jackyhzzjcn 2003-09-05
  • 打赏
  • 举报
回复
http://itextsharp.sourceforge.net/ 这东西不错的,我一直在用。
czlvc 2003-09-05
  • 打赏
  • 举报
回复
帮你顶~
xjaifly 2003-09-05
  • 打赏
  • 举报
回复
非常感谢你! lemong(風之影)
lemong 2003-09-04
  • 打赏
  • 举报
回复
这是一个vb.net的例子,希望有帮助

Function ConvertFile(ByVal strSourceFileName As String) As String
Dim pdf As ACRODISTXLib.PdfDistiller = New ACRODISTXLib.PdfDistiller()
lblStatus.Text = "Converting file......"
msWord = CreateObject("Word.Application")
msWord.Application.Visible = True
msWord.ActivePrinter = "Acrobat Distiller"
msDoc = msWord.Documents.Open(strSourceFileName)
msWord.ActiveDocument.PrintOut(False, False, , fileA & ".ps")
' Should check and quit word when done
Do While msWord.BackgroundPrintingStatus > 0
Application.DoEvents()
Loop
CType(msDoc, Word._Document).Close(False)
CType(msWord, Word._Application).Quit(False)
ConvertFile = True
pdf.FileToPDF(fileA & ".ps", fileA & ".pdf", "")
'pdf.DistillFile(fileA & ".ps", fileA, False)

If File.Exists(fileA & ".ps") Then
Kill(fileA & ".ps")
End If

If File.Exists(fileA & ".txt") Then
Kill(fileA & ".txt")
End If
End Function
lemong 2003-09-04
  • 打赏
  • 举报
回复
The easiest way to read a Word document is probably to use Word itself. This article describes how to interface with Office using C#:

http://msdn.microsoft.com/library/en-us/dnofftalk/html/office02072002.asp

Then to write to PDF, you need a C# PDF library like this one:

http://itextsharp.sourceforge.net/

Your job is to figure out the mapping.
xjaifly 2003-09-04
  • 打赏
  • 举报
回复
请问你有完整的原代码吗?
zhbname 2003-09-03
  • 打赏
  • 举报
回复
通过引用.PDF的DLL.
chainet 2003-09-03
  • 打赏
  • 举报
回复
不行,只能在Adobe 中转换.加密pdf文件的更不行.

110,534

社区成员

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

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

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