首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >是否将表格从pdf导出到excel?

是否将表格从pdf导出到excel?
EN

Stack Overflow用户
提问于 2011-08-03 19:05:48
回答 3查看 2.6K关注 0票数 1

如何通过C#编程只将表格内容导出到excel文件中?我目前正在使用PDFNET SDK从PDF中提取所有内容,但无法将表格作为表格结构读取

EN

回答 3

Stack Overflow用户

发布于 2011-08-03 19:40:27

我知道这个产品没有使用SDK,但我使用的是单机版产品。它将PDF的内容读取到电子表格中(许多导出选项)。

该产品是Nuance http://australia.nuance.com/for-business/by-product/omnipage/index.htm的OmniPage。

有一个免费评估的SDK。

票数 2
EN

Stack Overflow用户

发布于 2017-07-05 16:48:24

使用bytescount PDF Extractor SDK,我们可以提取整个页面,如下所示。

代码语言:javascript
运行
复制
        CSVExtractor extractor = new CSVExtractor();
        extractor.RegistrationName = "demo";
        extractor.RegistrationKey = "demo";

        TableDetector tdetector = new TableDetector();
        tdetector.RegistrationKey = "demo";
        tdetector.RegistrationName = "demo";

            // Load the document
        extractor.LoadDocumentFromFile("C:\\sample.pdf");
        tdetector.LoadDocumentFromFile("C:\\sample.pdf");

           int pageCount = tdetector.GetPageCount();

            for (int i = 1; i <= pageCount; i++)
            {
                int j = 1;

                    do
                    {
                            extractor.SetExtractionArea(tdetector.GetPageRect_Left(i),
                            tdetector.GetPageRect_Top(i),
                            tdetector.GetPageRect_Width(i),
                            tdetector.GetPageRect_Height(i)
                        );

                        // and finally save the table into CSV file
                        extractor.SavePageCSVToFile(i, "C:\\page-" + i + "-table-" + j + ".csv");
                        j++;
                    } while (tdetector.FindNextTable()); // search next table
            }

因为这是一个老帖子,希望它能帮助其他人。

票数 0
EN

Stack Overflow用户

发布于 2017-11-02 11:43:51

上面的答案(John)有效,它真的很有用。

但是我使用bytescount PDF Extrator SDK工具,而不是使用代码。

顺便说一下,该工具将在一个excel文件中生成大量的工作表。

您可以在excel中使用下面的代码将其生成为一个工作表。

代码语言:javascript
运行
复制
Sub ConvertAsOne()
Application.ScreenUpdating = False
For j = 1 To Sheets.Count
If Sheets(j).Name <> ActiveSheet.Name Then
   X = Range("A65536").End(xlUp).Row + 1
   Sheets(j).UsedRange.Copy Cells(X, 1)
End If
Next
Range("B1").Select
Application.ScreenUpdating = True
MsgBox "succeed!", vbInformation, "note"
End Sub
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6925477

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档