使用Spire.Pdf需要引用Spire.License.dll和Spire.Pdf.dll两个dll文件
下载地址:https://download.csdn.net/download/Artists39/12685592
1.pdf转word
PdfDocument doc = new PdfDocument();//读取pdfdoc.LoadFromFile("1.pdf");//pdf转word 格式设置doc.SaveToFile("1.doc", FileFormat.DOC);
2.读取pdf文本
PdfDocument doc = new PdfDocument();//读取pdfdoc.LoadFromFile("1.pdf");StringBuilder buffer = new StringBuilder();foreach (PdfPageBase page in doc.Pages){buffer.Append(page.ExtractText());}doc.Close();Console.WriteLine(buffer.ToString());buffer = null;