View as Markdown
OCRSpace icon

OCRSpace ACTION

Process PDF for OCR

Submit a PDF for OCR processing. See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's OCRSpace account once, then configure and run Process PDF for OCR from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "ocrspace-process-pdf",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    ocrspace: { authProvisionId: "apn_xxxxxxx" },
    language: "Language",
    isOverlayRequired: true,
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Process PDF for OCR inputs
Property Type Description
language Language string
Language setting for image OCR processing.
Optional
isOverlayRequired Is Overlay Required boolean
If true, returns the coordinates of the bounding boxes for each word. If false, the OCR'ed text is returned only as a text block (this makes the JSON response smaller). Overlay data can be used, for example, to show text over the image.
Optional
detectOrientation Detect Orientation boolean
If set to true, the api autorotates the image correctly and sets the TextOrientation parameter in the JSON response. If the image is not rotated, then TextOrientation=0, otherwise it is the degree of the rotation, e. g. "270".
Optional
scale Scale boolean
If set to true, the api does some internal upscaling. This can improve the OCR result significantly, especially for low-resolution PDF scans. Note that the front page demo uses scale=true, but the API uses scale=false by default. See also this OCR forum post.
Optional
isTable Is Table boolean
If set to true, the OCR logic makes sure that the parsed text result is always returned line by line. This switch is recommended for table OCR, receipt OCR, invoice processing and all other type of input documents that have a table like structure.
Optional
ocrEngine OCR Engine string
Engine 1 is default. See OCR Engines.
Optional
file PDF File string
The URL of the PDF file or the path to the file saved to the /tmp directory (e.g. /tmp/example.pdf) to process. See the documentation.
Required
syncDir SyncDir dir
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
ocrspace-process-pdf
Version
0.1.4
App
OCRSpace
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes