Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Document Engine example — deploying on OrbStack with Kubernetes

This example demonstrates a minimal installation of Nutrient Document Engine on a local Kubernetes cluster using OrbStack.

About OrbStack

OrbStack is a fast, lightweight alternative to Docker Desktop for macOS. It provides native support for running Docker containers and Kubernetes clusters with minimal resource usage and excellent performance.

This example uses OrbStack’s built-in Kubernetes support to deploy Document Engine locally, making it ideal for:

  • Local development and testing
  • Learning Document Engine deployment on Kubernetes
  • Prototyping before deploying to production clusters

Prerequisites

  • OrbStack installed with Kubernetes enabled
  • kubectl - Kubernetes command-line tool
  • Helm - Kubernetes package manager

You can install kubectl and Helm on macOS using Homebrew:

brew install kubectl helm

Getting started

  1. Install OrbStack and enable Kubernetes (one-time setup)

    Install OrbStack for macOS, then open the OrbStack app and enable Kubernetes from the settings panel. To verify Kubernetes is running:

    kubectl version
  2. Run the automated setup script

    ./setup.sh

The script will automatically install all dependencies and deploy Document Engine. This typically takes 3-5 minutes.

API usage examples

Once Document Engine is running, you can use the Document Engine API to perform different operations. Below are a few examples:

Upload a document

Upload the sample PDF document:

curl --request POST \
  --url http://document-engine.k8s.orb.local/api/documents \
  --header 'Authorization: Token token=secret' \
  --form 'pdf-file-from-multipart=@sample.pdf' \
  --form 'instructions={"parts":[{"file":"pdf-file-from-multipart"}],"actions":[],"output":{"type":"pdf","metadata":{"title":"Test Document","author":"API User"}}}'

The response will include a document_id that you can use in the following examples.

List documents

curl --request GET \
  --url http://document-engine.k8s.orb.local/api/documents \
  --header 'Authorization: Token token=secret'

Get document information

Replace DOCUMENT_ID with the actual document ID from the upload response:

curl --request GET \
  --url http://document-engine.k8s.orb.local/api/documents/DOCUMENT_ID/document_info \
  --header 'Authorization: Token token=secret'

Extract text

Extract text from all pages:

curl --request GET \
  --url http://document-engine.k8s.orb.local/api/documents/DOCUMENT_ID/pages/text \
  --header 'Authorization: Token token=secret'

Download PDF

Download the processed PDF:

curl --request GET \
  --url http://document-engine.k8s.orb.local/api/documents/DOCUMENT_ID/pdf \
  --header 'Authorization: Token token=secret' \
  --output downloaded-document.pdf

Support

Nutrient offers support for customers with an active SDK license via Nutrient Support.

Are you evaluating our SDK? That's great, we're happy to help out! To make sure this is fast, please use a work email and have someone from your company fill out our sales form.

License

This project is licensed under the BSD license. See the LICENSE file for more details.

Contributing

Please ensure you have signed our CLA so that we can accept your contributions.