Using an Document AI Processor
This lesson describes how to use a Document AI Processor to process an Invoice
Last updated
This lesson describes how to use a Document AI Processor to process an Invoice
Last updated
In this example, the function code receives a bucketName and a file in the bucket. It assumes that this file is an “Invoice” type. Using type, it retrieves the URL of the Google Document AI processor and processes the invoice (for extraction of data). It returns the response of the processor.
Prerequisite
In this lesson it is assumed that the Invoice-1234567.pdf file exists in the bucket (shown above).
Google Document AI invoice processor is configured as shown in the screenshot below.
Steps
Create a new function called DocumentAIProcessor.java.
Set parameters in its function details file.
Call DocumentAIProcessor.process method.
Check the result for failure.
Return Result object (if there is failure) else return the response document