@@ -20,37 +20,21 @@ Include the following maven dependency in your project to use the helper library
20
20
### Usage
21
21
The ` Client ` class is the entry point for most of the helper library features.
22
22
23
- Configuring and using a client to parse invoices, receipts, financial documents, and passports
23
+ Configuring and using a client to parse invoices (or receipts, passports, ...)
24
24
``` java
25
- Client client = new Client (" <MINDEE API KEY>" );
26
- InvoiceV4Response invoiceResponse = client. loadDocument(new File (" src/main/resources/invoices/invoice1.pdf" ))
27
- .parse(InvoiceV4Response . class, ParseParameters . builder()
28
- .documentType(" invoice" )
29
- .build());
30
-
31
- ReceiptV4Response receiptResponse = client. loadDocument(new File (" src/main/resources/receipts/receipt1.pdf" ))
32
- .parse(ReceiptV4Response . class, ParseParameters . builder()
33
- .documentType(" receipt" )
34
- .build());
35
-
36
- FinancialDocumentResponse finDocResponse = client. loadDocument(new File (" src/main/resources/findocs/findoc1.pdf" ))
37
- .parse(FinancialDocumentResponse . class, ParseParameters . builder()
38
- .documentType(" financial_doc" )
39
- .build());
40
- ```
25
+ MindeeClient mindeeClient = new MindeeClient (new MindeeSetings (" <MINDEE API KEY>" ));
41
26
42
- Custom documents are supported as well and can be parsed as follows:
43
- ``` java
44
- CustomDocumentResponse bill = client. loadDocument(new File (" src/test/resources/custom/custom1.pdf" ))
45
- .parse(CustomDocumentResponse . class, ParseParameters . builder()
46
- .documentType(" bill_of_lading_line_items" )
47
- .accountName(" <your account name>" )
48
- .build());
27
+ DocumentToParse documentToParse = mindeeClient. loadDocument(new File (" src/main/resources/invoices/invoice1.pdf" ));
28
+
29
+ Document<InvoiceV4Inference > invoiceDocument = mindeeClient. parse(
30
+ InvoiceV4Inference . class,
31
+ documentToParse);
49
32
```
50
33
51
- The Client ` loadDocument ` method supports multiple input types:
34
+ Client supports multiple input types:
52
35
53
36
* java.io.File file
37
+ * InputStream fileAsStream, String filename
54
38
* byte[ ] fileAsByteArray, String filename
55
39
* String fileAsBase64String, String filename
56
40
0 commit comments