3
  1. Word または Excel ファイルから作成された PDF ファイルがいくつかあります。

  2. 表にある情報を取得する必要があります。

  3. ドキュメント内のテキストは画像ではないため、pdfbox などのツールを使用してテキストを抽出できます。

  4. テーブルの境界線がどこにあるのかわからないため、テキストがテーブルのどのセルに属しているかを知る方法がありません。

  5. 私は abby や solid pdf コンバーターなどのいくつかのデスクトップ ツールを試してみましたが、それらはファイルを素敵な Word ドキュメントに変換できますが、C# でプログラム的にこれを実行できるようにしたいので、これは私のニーズには合いません。

  6. 一部のテーブルにはネストされたテーブルがあり、これが少し難しいと思います。

私はあなたの助けに感謝します

4

1 に答える 1

1

The difficulty here is caused by the fact that the text in the PDF is not contained within any table. It might look like it is, but underneath the surface, it is not.

So there are a couple of options that I can think of. But none of them are going to be quite as satisfying as you'd probably like.

  1. There are some companies that offer SDKs for PDF to Excel/Word conversion. Investintech and Iceni are a couple of examples. But these solutions are not free.
  2. If you know the exact layout of the PDF files that you need to extract the table data from, then you can use any SDK that lets you extract text from a PDF and also tells you the exact co-ordinates of the extracted text. Using this method you need to know in advance where the text is going to be, so that you can extract text from a specific area on the page. It obviously won't work if you need to process any random document.

It's a difficult task, but hopefully this will give you a starting point.

于 2010-08-20T12:19:54.713 に答える