iText 7 pdf2Data
pdf2Dataを使用すると、PDFの処理を自動化して、大量の同じ形式のPDF文書からデータを簡単に抽出することができます。テンプレートで定義できる選択ルールに基づいて、PDF文書内にあるデータを認識するフレームワークを提供します。
pdf2DataはiText 7向け商用ライセンスのアドオンの1つで、商用目的やクローズドソースでこの製品を使用する場合には、iText 7 Coreとpdf2Data向けの商用ライセンスが必要です。プロジェクト向けのライセンスおよび価格設定に関する詳細については、お見積もりをご依頼ください。
How iText pdf2Data works
Many PDF documents businesses need to process, such as registration forms, invoices etc. follow a common structure. If we take the example of an invoice document, addresses, purchase order numbers and similar document elements tend to be located in one place, and only the content such as item descriptions, quantities and cost of items change from invoice to invoice.
iText pdf2Data offers an easy way to extract data from such PDF documents by defining areas and rules in a template which correspond to the content you want to extract. The template can then be visually validated with other documents to confirm data is recognized correctly, before being parsed by the pdf2Data SDK to process all subsequent documents matching that template.
Unlike AI-based alternatives, you don’t need hundreds of samples and intensive supervision to train the recognition process. The content recognition is controlled by the template you configure, meaning no training is required before you can begin extracting data. You only need one example document to enable data extraction from all subsequent documents.
AI recognition has other disadvantages too. Any changes to the required output (such as adding a new field) will require models to be retrained, and multiple language support is minimal at best. Documents using the same layout but containing content in different languages can give wildly inconsistent results.
iText pdf2Data on the other hand suffers from none of these drawbacks. Making modifications to templates is quick and easy, and it offers excellent language support.
Using the pdf2Data template creator
By using the intuitive browser-based pdf2Data template creator, it’s easy to create a template for data extraction. Simply create a template PDF based on a sample document, by defining selectors for areas of interest. Selectors are configurable rules to detect different types of content for extraction.
Many selectors are available to define, including Date
, Time
, Image
, Barcode
, Table
, Price
etc. enabling pdf2Data to intelligently recognize and extract data and other content. The selectors can be configured to detect:
- page range and the position on the page
- specific font styles, font color, and text patterns
- fixed keywords next to the data
- automatic recognition of table structures
The pdf2Data template creator was designed to allow non-developers such as business users or functional analysts to define and modify templates as required, enabling more collaborative workflows.
Want to try it out? We have an online demo of pdf2Data to test with an example document, or one you upload yourself.
The recognition process is based on the following steps:
Step 1. Upload a sample PDF document (this will become our template).
Step 2. Select data in the document you would like to extract and define relevant extraction rules (selectors) for the correct data extraction.
Step 3. Upload any other PDF document based on the same template and confirm your data was recognized correctly.
Step 4. Start using the template in the pdf2Data server-side component. You can integrate it into your document workflow as a Java or .NET library, or as a command-line application, enabling you to process potentially millions of documents with ease.
Using the pdf2Data SDK to extract data
Below you can see an example of using the pdf2Data SDK to parse a pre-defined template. After loading the license file required to enable pdf2Data to work, you can parse a document against your template and extract the data with just a couple of lines of code.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Make sure to load license file before invoking any code
LicenseKey.loadLicenseFile(pathToLicenseFile);
// Parse template into an object that will be used later on
Template template = Pdf2DataExtractor.parseTemplateFromPDF(pathToPdfTemplate);
// Create an instance of Pdf2DataExtractor for the parsed template
Pdf2DataExtractor extractor = new Pdf2DataExtractor(template);
// Feed file to be parsed against the template. Can be called multiple times for different files
ParsingResult result = extractor.recognize(pathToFileToParse);
// Save result to XML or explore the ParsingResult object to fetch information programmatically
result.saveToXML(pathToOutXmlFile);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Make sure to load license file before invoking any code
LicenseKey.LoadLicenseFile(pathToLicenseFile);
// Parse template into an object that will be used later on
Template template = Pdf2DataExtractor.ParseTemplateFromPDF(pathToPdfTemplate);
// Create an instance of Pdf2DataExtractor for the parsed template
Pdf2DataExtractor extractor = new Pdf2DataExtractor(template);
// Feed file to be parsed against the template. Can be called multiple times for different files
ParsingResult result = extractor.Recognize(pathToFileToParse);
// Save result to XML or explore the ParsingResult object to fetch information programmatically
result.SaveToXML(pathToOutXmlFile);
Data is extracted in XML format, such as the example below:
<?xml version="1.0" encoding="UTF-8"?>
<elements>
<data name="DATE">
<text x="61.4" y="519.83" width="38.56" height="8.0" page="1">08/12/2016</text>
<text x="96.28" y="477.57" width="38.56" height="8.0" page="2">16/01/2017</text>
</data>
<data name="END_USER_ADDRESS">
<text x="102.25" y="612.39" width="98.84" height="40.0" page="1">Angela Merkel
To the att. of Angela Merkel
059-X025 KucheMacherStraße
71060 Sandelfängen Germany</text>
</data>
<data name="FAX">
<text x="486.04" y="727.53" width="58.16" height="9.0" page="1">+32 92 70 33 75</text>
</data>
</elements>
Resources
Here you will find the needed resources to install, configure and use the iText pdf2Data components. If you’re looking for a demonstration of how iText pdf2Data works, make sure to check out our online demo where you can test it with an example document, or one you upload yourself.
Other resources
iText 7 pdf2Dataを使う理由
データは重要な商品であり、認識できる以上のデータがPDF文書に隠されています。当然のことながら、このデータを手動で収集するのは時間がかかり、入力ミスのリスクだけでなく、 セキュリティ上の問題も高くなります。pdf2Dataを使用すると、 データを安全な方法で抽出するプロセスを自動化できます。pdf2Dataが持つその他のメリットについては続きをお読みください。
PDF版請求書や文書からのデータ抽出を自動化
テンプレートで重要な情報を定義し、Javaや.NETでのプログラミングを用いて自動的に取り出すことで、 大量のPDFから データを抽出して処理します。
抽出したいデータ部分を具体的に定義する
pdf2Dataテンプレートエディタを用いて、 テンプレートに抽出したい情報をすばやく定義します(PDF版 請求書の右上端に常にある住所のフィールドなど)。
既存の文書処理への統合
pdf2Dataはオープン標準を使用して統合を容易にし、これにより、既存ワークフローへの統合を 容易かつ迅速に行います。これにはJava用SDKと.NET用SDK、ならびにコマンドラインインターフェイスが含まれています。
iText 7 pdf2dataのコア機能
pdf2Dataは、請求書や受領書など、同じ形式で作成されたPDF文書のテンプレート上の領域、フォント、パターン、利息表を定義することで動作します。その後、セレクターを使って利息の領域を定義できます。各セレクターはさまざまな方法を使用して重要な情報を識別し、ニーズに合わせて単独または組み合わせて使用できます。
PDF文書からデータを抽出
iText 7 Coreの コンテンツ抽出機能を活用すると、テキストや画像に対する忠実度の高い認識プロセスを行うことができます。
直感的な抽出設定
このアドオンは拡張とカスタマイズできる柔軟性を持つ総合的でオリジナルな機能を備えています。統合のしやすさとオープンスタンダードに重きを置いています。
テンプレートを使用して抽出を合理化
目的の領域と選択ルールを定義すれば、必要なコンテンツを正確に取得できます。
PDFやデータのワークフローに統合
抽出したコンテンツのページ座標にアクセスして、さらなる処理の為にデータを構造化され、再利用ができる形式で出力します。
iText DITO, a data-driven template-based PDF generator
Now you’ve got data extraction through templating done and dusted, are you interested in a template-based solution for PDF creation from data?
