MARKETPLACE
PLUGINS
GOOGLE DOCUMENT AI - OCR
Google Document AI - OCR logo

Google Document AI - OCR

Published June 2023
   โ€ข    Updated this month

Plugin details

Extracts and prints form fields and tables.
This plugin returns the detected text along with the detected languages and pages' layout.

This plugin provides Google Document AI - OCR services in two request modes:
- ANALYZE DOCUMENT (FRONT-END DESKTOP & NATIVE MOBILE): Synchronous request mode with client-side processing, ideal for mobile applications and improved responsiveness.
- ANALYZE DOCUMENT (BACK-END): Synchronous request mode, useful for small file and time-sensitive application.
- START & GET ANALYZE DOCUMENT (ASYNC): Asynchronous request mode, useful for large files, time-insensitive application, requiring a Google Cloud Storage Bucket.

A script is provided to automatically configure your Google Cloud settings.

Demo Link: https://gcpdocumentaiocrdemo.bubbleapps.io/version-test

Editor Link: https://bubble.io/page?type=page&name=index&id=gcpdocumentaiocrdemo-editor&tab=tabs-1

๐Ÿ’ก ๐—ฆ๐˜‚๐—ฏ๐˜€๐—ฐ๐—ฟ๐—ถ๐—ฝ๐˜๐—ถ๐—ผ๐—ป๐˜€ ๐—ฎ๐—ฟ๐—ฒ ๐—ฝ๐—ฟ๐—ผ๐—ฟ๐—ฎ๐˜๐—ฒ๐—ฑ. ๐—œ๐—ณ ๐˜†๐—ผ๐˜‚ ๐—ถ๐—ป๐˜€๐˜๐—ฎ๐—น๐—น ๐—ฎ๐—ป๐—ฑ ๐˜‚๐—ป๐˜€๐˜‚๐—ฏ๐˜€๐—ฐ๐—ฟ๐—ถ๐—ฏ๐—ฒ ๐˜๐—ต๐—ถ๐˜€ ๐—ฝ๐—น๐˜‚๐—ด๐—ถ๐—ป ๐—ถ๐—ป ๐—ผ๐—ป๐—ฒ ๐—ฑ๐—ฎ๐˜† ๐˜๐—ผ ๐˜๐—ฒ๐˜€๐˜ ๐—ถ๐˜ ๐—ผ๐˜‚๐˜, ๐˜†๐—ผ๐˜‚'๐—น๐—น ๐—ผ๐—ป๐—น๐˜† ๐—ฏ๐—ฒ ๐—ฐ๐—ต๐—ฎ๐—ฟ๐—ด๐—ฒ๐—ฑ ๐Ÿญ/๐Ÿฏ๐Ÿฌ๐˜๐—ต ๐—ผ๐—ณ ๐˜๐—ต๐—ฒ ๐—บ๐—ผ๐—ป๐˜๐—ต๐—น๐˜† ๐˜€๐˜‚๐—ฏ๐˜€๐—ฐ๐—ฟ๐—ถ๐—ฝ๐˜๐—ถ๐—ผ๐—ป ๐—ณ๐—ฒ๐—ฒ.

๐Ÿ“– ๐—ฆ๐˜๐—ฒ๐—ฝ-๐—ฏ๐˜†-๐—ฆ๐˜๐—ฒ๐—ฝ ๐—ถ๐—ป๐˜€๐˜๐—ฟ๐˜‚๐—ฐ๐˜๐—ถ๐—ผ๐—ป๐˜€ ๐—ฎ๐—ฟ๐—ฒ ๐˜๐—ต๐—ฒ "๐—œ๐—ป๐˜€๐˜๐—ฟ๐˜‚๐—ฐ๐˜๐—ถ๐—ผ๐—ป๐˜€" ๐˜€๐—ฒ๐—ฐ๐˜๐—ถ๐—ผ๐—ป ๐—ฎ๐—ป๐—ฑ ๐——๐—ฒ๐—บ๐—ผ ๐—˜๐—ฑ๐—ถ๐˜๐—ผ๐—ฟ ๐—ถ๐˜€ ๐—ถ๐—ป ๐˜๐—ต๐—ฒ "๐—Ÿ๐—ถ๐—ป๐—ธ๐˜€" ๐˜€๐—ฒ๐—ฐ๐˜๐—ถ๐—ผ๐—ป ๐—ผ๐—ณ ๐˜๐—ต๐—ฒ ๐—ฃ๐—น๐˜‚๐—ด๐—ถ๐—ป ๐—ฃ๐—ฎ๐—ด๐—ฒ.

Contact us at [email protected] for any additional feature you would require or support question.

$99

One time  โ€ข  Or  $5/mo

1.0 stars   โ€ข   1 ratings
20 installs  
This plugin does not collect or track your personal data.

Platform

Web & Native mobile

Contributor details

wise:able logo
wise:able
Joined 2020   โ€ข   122 Plugins
View contributor profile

Instructions

1๏ธโƒฃ: GOOGLE DOCUMENT AI - OCR (FRONT-END DESKTOP & NATIVE MOBILE) =======================================================

๐Ÿ“‹ ELEMENT DESCRIPTION
--------------------------------
GOOGLE DOCUMENT AI - OCR (FRONT-END DESKTOP & NATIVE MOBILE) provides ANALYZE DOCUMENT action to extract text from documents.
The front-end or native mobile element is suitable for applications when reactivity is desired, such as but not limited to, mobile applications.

๐Ÿ”ง STEP-BY-STEP SETUP
--------------------------------
โ„น๏ธ The steps from 0) to 1) can be automatically performed by logging in into your Google Cloud Console, opening the Cloud Shell (top right corner of your page) and copy pasting this command and press enter:

wget -q https://storage.googleapis.com/bubblegcpdemo/demo-assets/wiseable-gcp-documentai-sync-only.py && python3 wiseable-gcp-documentai-sync-only.py

0) Set-up a project from Google Cloud Console: https://cloud.google.com/document-ai/docs/setup
- Create or select a project
- Enable the DOCUMENT AI API for that project
- Create a service account
- Download a private key as JSON.

1) Open the private key JSON file with a text editor, copy/paste the following parameters from your file to the Plugin settings:
- CLIENT_EMAIL
- PROJECT_ID
- PRIVATE_KEY, including the -----BEGIN PRIVATE KEY-----\n prefix and \n-----END PRIVATE KEY-----\n suffix.

2) Register on plugins.wiseable.io. Create a new Credential which associates your BUBBLE APP URL, GCP PROJECT_ID, CLIENT_EMAIL & PRIVATE_KEY.
The registration service will generate your PUBLIC ACCESS KEY. This key serves as a secure proxy for your real API key. It allows your application to communicate with the service without exposing your real API key. Since this PUBLIC ACCESS KEY is explicitly tied to your registered BUBBLE APP URL, it can only be used from that domain, ensuring that even if the key is publicly visible, it remains safe and cannot be misused by unauthorized sources.

3) Enter in the PLUGIN SETTINGS your PUBLIC ACCESS KEY (used for front-end element only).

4) Add the GOOGLE DOCUMENT AI - OCR (FRONT-END DESKTOP & NATIVE MOBILE) element to the page on which the document recognition feature must be integrated. Select the RESULT DATA TYPE as Returned type, must always be set to "RESULT (DOCUMENTAI)".

5) Integrate the logic into your application using the following GOOGLE DOCUMENT AI - OCR (FRONT-END DESKTOP & NATIVE MOBILE) element's states and actions:

FIELDS:
- RESULT DATA TYPE: Returned type, must always be set to "RESULT (DOCUMENT AI - OCR)".  

EVENTS:
- SUCCESS: Event triggered upon success
- ERROR: Event triggered upon error

EXPOSED STATES:
Use any element able to show/process the data of interest (such as a Group with a Text field) stored within the result of the following states of the GOOGLE DOCUMENT AI - OCR (FRONT-END DESKTOP & NATIVE MOBILE) element:
- RESULTS: Populated upon SUCCESS event. Returns the detected text along with the detected languages and pages' layout.
- ERROR MESSAGE: Populated upon ERROR event.
- IS PROCESSING: Set to true when processing is in progress, false otherwise.

ELEMENT ACTIONS - TRIGGERED IN WORKFLOW:
- ANALYZE DOCUMENT (FRONT-END): Extract text from a document file. Populate RESULTS state upon completion.

Inputs Fields:
 - FILE: File from the Bubble.io picture uploader, a Protocol-relative URLs (//server/file.ext), or a HTTPS file URL (https://server/file.ext) or a Google Storage URL (gs://bucket/file.ext).
 - PROCESSOR ID: The ID of your processor. You will find this ID in your Google Cloud Console > Document AI > Processors > ID
 - PROCESSOR REGION: Your processor's region, for example: us - United States eu - European Union. You will find this location in your Google Cloud Console > Document AI > Processors > Region

2๏ธโƒฃ: ANALYZE DOCUMENT (BACK-END)
=======================

๐Ÿ“‹ ACTION DESCRIPTION
--------------------------------
ANALYZE DOCUMENT (BACK-END) from a file returns the detected text along with the detected languages and pages' layout. For back-end actions, the maximum retrievable result set is capped at 30 seconds duration time.

๐Ÿ”ง STEP-BY-STEP SETUP
--------------------------------
โ„น๏ธ The steps from 0) to 2) can be automatically performed by logging in into your Google Cloud Console, opening the Cloud Shell (top right corner of your page) and copy pasting this command and press enter:

wget -q https://storage.googleapis.com/bubblegcpdemo/demo-assets/wiseable-gcp-documentai-sync-only.py && python3 wiseable-gcp-documentai-sync-only.py

0) Set-up a project from Google Cloud Console: https://cloud.google.com/document-ai/docs/setup
- Create or select a project
- Enable the DOCUMENT AI API for that project
- Create a service account
- Download a private key as JSON.

1) Open the private key JSON file with a text editor, copy/paste the following parameters from your file to the Plugin settings:
- CLIENT_EMAIL
- PROJECT_ID
- PRIVATE_KEY, including the -----BEGIN PRIVATE KEY-----\n prefix and \n-----END PRIVATE KEY-----\n suffix.

2) In your Google Cloud Console > IAM > PERMISSION > Add the DOCUMENT AI VIEWER permissions to the service account created at the step 0.

3) In your Google Cloud Console > Document AI, create a FORM PARSER PROCESSOR. This PROCESSOR ID and REGION will be used in the following step: https://cloud.google.com/document-ai/docs/create-processor

4) Set up the action "ANALYZE DOCUMENT (BACK-END)" in the workflow.
 Inputs Fields:
   - FILE: PDF, TIFF, JPG, PNG, BMP, WEBP or GIF file from the Bubble.io picture uploader, a Protocol-relative URLs (//server/file.ext), or a HTTPS file URL (https://server/file.ext). Maximum file size of 20 MB and of 10 pages.
   - PROCESSOR ID: The ID of your processor. You will find this ID in your Google Cloud Console > Document AI > Processors > ID
   - REGION: Your processor's region, for example: us - United States eu - European Union. You will find this location in your Google Cloud Console > Document AI > Processors > Region
   - RESULT DATA TYPE: Returned type, must always be set to "RESULT (DOCUMENT AI - OCR)".
 Output Fields:
   - RESULTS: Returns the detected text along with the detected languages and pages' layout.

3๏ธโƒฃ: START & GET ANALYZE DOCUMENT (ASYNC)
=====================================

๐Ÿ“‹ ACTION DESCRIPTION
--------------------------------
START & GET ANALYZE DOCUMENT from a file returns the detected text along with the detected languages and pages' layout.  
Asynchronous request mode, useful for large files and time-insensitive application.

๐Ÿ”ง STEP-BY-STEP SETUP
--------------------------------
โ„น๏ธ If you intend to store your files in Google Cloud Storage, please refer to the instructions of "GOOGLE STORAGE DROPZONE & UTILITIES" plugin (https://bubble.io/plugin/google-storage-dropzone--utilities-1616855011494x235332313714262000) first to setup your bucket. Then follow the instructions below.

The steps from 0) to 1) can be automatically performed by logging in into your Google Cloud Console, opening the Cloud Shell (top right corner of your page) and copy pasting this command and press enter:

wget -q https://storage.googleapis.com/bubblegcpdemo/demo-assets/wiseable-gcp-documentai.py && python3 wiseable-gcp-documentai.py

Otherwise, follow these manual steps:

0) Set-up a project from Google Cloud Console: https://cloud.google.com/document-ai/docs/setup
- Create or select a project
- Enable the DOCUMENT AI API for that project
- Create a service account
- Download a private key as JSON.

1) Open the private key JSON file with a text editor, copy/paste the following parameters from your file to the Plugin settings:
- CLIENT_EMAIL
- PROJECT_ID
- PRIVATE_KEY, including the -----BEGIN PRIVATE KEY-----\n prefix and \n-----END PRIVATE KEY-----\n suffix.

2) In your Google Cloud Console > Document AI, create a FORM PARSER PROCESSOR. This PROCESSOR ID and REGION will be used in the following step: https://cloud.google.com/document-ai/docs/create-processor

3) Set up the action "START ANALYZE DOCUMENT OPERATION" in the workflow.
 Inputs Fields:
   - INPUT FILES: PDF, TIFF, JPG, PNG, BMP, WEBP or GIF list of files in Google Storage URL (gs://bucket/path/file.pdf) format.
   - MIME TYPE: A standard MIME type describing the format of the contents. Format type/subtype. Example: image/png, video/mp4. For more information, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
   - OUTPUT BUCKET: Output Bucket to store the results.
   - OUTPUT PATH: Folder to store the results in.
   - PROCESSOR ID: The ID of your processor. You will find this ID in your Google Cloud Console > Document AI > Processors > ID
   - REGION: Your processor's region, for example: us - United States eu - European Union. You will find this location in your Google Cloud Console > Document AI > Processors > Region
 Output Fields:
   - OPERATION NAME: ID of the operation, to be reused in the "GET ANALYZE DOCUMENT OPERATION RESULTS".

4) Set up the action "GET ANALYZE DOCUMENT OPERATION RESULTS" in a recurring workflow ('Do every x seconds'), to poll the operation completion status on a regular basis.
 Configure this recurring workflow to retrieve the results once the OPERATION STATUS is 'SUCCEEDED', using Only When' Event Condition,
 Inputs Fields:
   - OUTPUT TYPE: Returned type, must always be set to "RESULT (DOCUMENT AI - OCR)".
   - OPERATION NAME: ID of the operation to poll, returned by "START ANALYZE DOCUMENT OPERATION" action.
   - REGION: Your processor's region, for example: us - United States eu - European Union. You will find this location in your Google Cloud Console > Document AI > Processors > Region.

 Output Fields:
   - RESULTS: Returns the detected text along with the detected languages and pages' layout.

๐Ÿ” IMPLEMENTATION EXAMPLE
======================
Feel free to browse the app editor in the Service URL for an implementation example.

โ„น๏ธ ADDITIONAL INFORMATION
======================
> Supported file formats: https://cloud.google.com/document-ai/docs/file-types

> Supported Languages: https://cloud.google.com/document-ai/docs/processors-list#expandable-1

> GOOGLE DOCUMENT AI service limits: https://cloud.google.com/document-ai/quotas

โš ๏ธ TROUBLESHOOTING
================
Any plugin related error will be posted to the Logs tab, "Server logs" section of your App Editor.
Make sure that "Plugin server side output" and "Plugin client side output" is selected in "Show Advanced".

For front-end actions, you can also open your browser's developer console (F12 or Ctrl+Shift+I in most browsers) to view detailed error messages and logs.

Always check the ERROR MESSAGE state of the element and implement error handling using the ERROR event to provide a better user experience.

> Server Logs Details: https://manual.bubble.io/core-resources/bubbles-interface/logs-tab#server-logs

โšก PERFORMANCE CONSIDERATIONS
===========================

โฑ๏ธ BACK-END ACTION START DELAY
-----------------------------------------------
Each time a server-side action is called, Bubble initializes a small virtual machine to execute the action. If the same action is called shortly after, the caching mechanism kicks in, resulting in faster execution on subsequent calls.

A useful workaround is to fire a dummy execution at page load, which pre-warms the Bubble engine for the next few minutes, reducing the impact of cold starts for your users.

For back-end actions, the maximum retrievable result set is capped at 30 seconds duration time - this does not apply to front-end actions.

โ“ QUESTIONS?
===========
Contact us at [email protected] for any additional feature you would require or support question.

Types

This plugin can be found under the following types:
Api   โ€ข   Background Services   โ€ข   Element   โ€ข   Event   โ€ข   Action

Categories

This plugin can be found under the following categories:
Media   โ€ข   Productivity   โ€ข   AI   โ€ข   Mobile   โ€ข   PDF   โ€ข   Visual Elements

Resources

Support contact
Documentation
Tutorial

Rating and reviews

Average rating (1.0)

Does not provide full document AI output
March 8th, 2024
Unfortunately I intended to use this plug in to extract text and layout information such a text block locations. Even though it has mentioned that it provides the layout, the output for layout is only the orientation of the page. you can get the same result from a free bubble OCR plug-in.
Thanks Zareh Sa for your feedback. The plugin provides layout orientation, which is the name of the field returned by Google system providing orientation. It is also the terminology used in printing systems, such as landscape or portrait as page layout - which differs from block-level positioning and layout. Lastly, it would have been fair to share in your review that we exchanged 30 emails in order to understand your use case and advising on the available options, which was this plugin with custom development which you chose not to undertake. Lastly, free OCR plugins on the marketplace do not support models uptraining, which is possible with this plugin, which was also part of our recommendation given your use case Therefore, it shouldnโ€™t come as a surprise that the plugin doesnโ€™t meet your requirements as we duly advised. All that being said, we remain as your disposal should you wish to proceed to meet your requirements. (plugin author)
March 9th, 2024
  โ€ข  
wise:able
Bubble