如何使用Windows窗体应用程序将pdf文件转换为Excel

问题描述:

任何人都可以帮我解决代码???

Can anyone please help me with code???

您好

请尝试任何第三方SDK,允许您编写最少的代码以满足所需的工作。我尝试过ByteScout PDF SDK,它为您提供了更大的灵活性和易于集成。下面是在C#中将PDF转换为Excel的示例代码

Please try any third party SDK, which allows you to write minimal code to for required work. I have tried ByteScout PDF SDK which give you more flexibility and easy integration. Below is the sample code to convert PDF to excel in C#

// Create Bytescout.PDFExtractor.XLSExtractor instance
            <span data-scayt_word="CSVExtractor" data-scaytid="6">CSVExtractor</span> extractor = new <span data-scayt_word="XLSExtractor" data-scaytid="7">XLSExtractor</span>();
            extractor.RegistrationName = "demo";
            extractor.RegistrationKey = "demo";
 
            File.Delete("output.xls");
 
            // Load sample PDF document
            extractor.LoadDocumentFromFile("sample3.pdf");
             
            // Save the spreadsheet to file
            extractor.SaveAsXLSFile("output.xls");
 
            // Open the spreadsheet in default associated application
            Process.Start("output.xls");

根据需要自定义根据您的要求。

Customize it according to your requirement.