# Engineering Drawing PDF Dimension Extractor (`madrasco/drawing-pdf-dimension-extractor`) Actor

Reads vector engineering-drawing PDFs and returns a table of dimension values with page positions and confidence flags, plus a sheet-size check. Vector PDFs only (no OCR). An extraction aid: check results against the drawing.

- **URL**: https://apify.com/madrasco/drawing-pdf-dimension-extractor.md
- **Developed by:** [Jack Valmadre](https://apify.com/madrasco) (community)
- **Categories:** Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 dimension candidates

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Engineering Drawing PDF Dimension Extractor

Extract numeric dimension candidates from the text layer of engineering-drawing PDFs for document indexing and review. Get a table with each candidate's text, numeric value, page position and surrounding text, plus JSON and CSV files for each parsed PDF.

DrawX is an extraction aid. It can miss dimensions and include drawing numbers, labels or other unrelated numbers. Check candidates against the original drawing.

### What you get

- Dimension candidates with page number, position, explicit units, diameter or radius prefixes, and symmetric ± tolerance where recognized.
- Surrounding text and distance to nearby drawn lines to help review candidates.
- A document summary with processing status, candidate counts, page dimensions and recognized sheet-size matches.
- JSON and CSV files in the run's key-value store.

The `high` and `low` confidence labels describe the text syntax, not measured accuracy: `high` means a recognized prefix, tolerance or unit is present; `low` means a bare numeric candidate. Neither label confirms that a number is a dimension or that its value is correct.

### Input

Use public PDF URLs, PDFs in your own private Apify key-value store, or both. Supply at least one document. PDFs need a readable text layer; image-only scans and text converted to outlines are unsupported. DrawX does not perform OCR.

For private PDFs:

1. Upload the PDFs as records in a private key-value store in your Apify account.
2. Select that store in `inputStoreId`. The input requests read access to the selected store.
3. Enter the exact record keys in `inputKeys`, including any filename extension. DrawX reads only the keys you list; it does not process every record in the store.

The actor input has no direct file-upload field. Keep private files in the selected store rather than pasting private Apify file URLs into `pdfUrls`.

| Field | Meaning |
|---|---|
| `pdfUrls` | Optional list of public HTTP or HTTPS PDF URLs. |
| `inputStoreId` | Optional private key-value store selected for read access. Use with `inputKeys`. |
| `inputKeys` | Exact PDF record keys to read from the selected store. Use with `inputStoreId`. |
| `minConfidence` | `low` includes both labels; `high` returns only candidates with recognized dimension syntax in the dataset. |
| `maxPages` | Optional limit on pages processed per PDF. |
| `maxFileSizeMb` | File size limit per PDF, default 50 MB. |

For example, after uploading a PDF under the key `DRAWING.pdf`:

```json
{
  "inputStoreId": "YOUR_PRIVATE_STORE_ID",
  "inputKeys": ["DRAWING.pdf"],
  "minConfidence": "low"
}
```

### Output

The dataset contains two row types:

- `dimension`: candidate text and value, page, position, prefix, tolerance, unit, confidence label and `lineContext` (surrounding text).
- `document_summary`: processing status, counts and per-page sheet-size information.

The Dimensions view includes `lineContext`; use it to check the original text around a candidate, especially when a symbol is absent from the structured prefix. Use the Document summaries view to check each file's processing status. Use `recordType` to distinguish the row types when exporting or processing the dataset. Positions are text centers in millimeters from the bottom-left of the PDF page, not dimensions of the physical part.

The key-value store contains a JSON report and CSV candidate table for each successfully parsed PDF, plus an `OUTPUT` run summary. JSON and CSV contain all detected candidates from the processed pages; the dataset's confidence filter and billing cap do not filter these files. The dataset and file exports use different field names: for example, dataset `lineContext` is CSV `line_context`. For private-store inputs, `sourceUrl` identifies the store and record as `apify://<store-id>/<URL-encoded-record-key>`; it is a source identifier, not a download link.

If a PDF cannot be read from its source or parsed, its summary records the problem and processing continues with the next PDF. If every attempted document has an input or parsing error, the run ends with `FAILED` after saving the summaries and `OUTPUT`. An unsupported PDF with no readable text receives a `no_text_*` summary; that status does not fail the run. An empty document list fails the run.

### Limits

- Numeric labels can appear as candidates even when they are far from drawn geometry.
- Bare four-digit integers are skipped, including genuine dimensions such as `1200`.
- Bare single digits are retained only when they stand alone near a drawn line. Title-block numbers can still appear.
- Some diameter glyphs, including lowercase `ø`, are not recognized as prefixes. Check `lineContext`; high-only filtering can omit these values.
- Signed values, fractions and complex tolerance layouts may be incomplete or misread.
- Units are reported only when recognized beside a value. Drawing units and scale are not inferred.
- Candidates are not linked to the features they measure. DrawX does not interpret GD\&T frames.
- Sheet-size matching compares PDF page dimensions with a built-in size table. It does not assess drawing-standard compliance.
- A PDF can contain readable labels while its dimension text remains unreadable.

Use the results for document indexing and review. Do not use them to authorize manufacturing, inspection, quoting, compliance or safety decisions.

### Pricing

US$5 per 1,000 dimension candidates saved to the dataset (US$0.005 each), plus US$0.00005 per run start per GB of memory, with a minimum of one start event. Document summaries and error rows are free. For example, 100 candidate rows at 1 GB cost US$0.50005. No separate actor compute charge is added to this event price; other Apify services or storage can incur platform charges.

Set a maximum charge per run. If it leaves no allowance for a dimension, the actor stops before processing more PDFs. If a document has more candidates than the remaining allowance, its dataset rows are truncated, its summary marks the truncation, and `OUTPUT` lists unprocessed PDFs. Full JSON/CSV files can include candidates beyond the charged dataset rows.

### Privacy

PDF contents are processed inside the actor without an OCR or model API. The actor downloads public files from the URLs you supply, reads the listed PDF records from your selected private store, and writes results to your Apify storage. The input field requests read access to the selected store, not write access. DrawX does not write to that input store. Input PDFs, run logs (including source URLs or private store and record identifiers) and outputs follow your Apify storage and retention settings.

### Support

Use the Issues tab for questions or extraction problems. Share only PDFs you have permission to disclose.

Built and maintained by AI agents for Madrasco. Support replies may be AI-assisted; a human owner is reachable on request.

# Actor input Schema

## `pdfUrls` (type: `array`):

Public HTTP(S) URLs of vector drawing PDFs. For private files, upload to your own Apify key-value store and use Private input store and Record keys below.

## `minConfidence` (type: `string`):

'low' returns numeric candidates from the text layer (most real drawings have bare numbers, so most true dimensions are 'low'). 'high' returns only values with explicit dimension syntax (Ø, R, ±, a unit).

## `maxPages` (type: `integer`):

Stop after this many pages of each PDF (empty = all pages).

## `maxFileSizeMb` (type: `integer`):

Skip PDFs larger than this.

## `inputStoreId` (type: `string`):

Select your private key-value store containing the PDFs. Grants this run read-only access to that store under limited permissions.

## `inputKeys` (type: `array`):

Exact PDF record keys in the selected private store, for example DRAWING.pdf. Upload files to that store before running.

## Actor input object example

```json
{
  "pdfUrls": [
    "https://datasheets.raspberrypi.com/rpi5/raspberry-pi-5-mechanical-drawing.pdf"
  ],
  "minConfidence": "low",
  "maxFileSizeMb": 50
}
```

# Actor output Schema

## `dimensions` (type: `string`):

One dataset row per extracted dimension value with page position and confidence flags (the Documents view has one row per PDF).

## `files` (type: `string`):

The full extraction as JSON and CSV for each input PDF.

## `summary` (type: `string`):

Per-document overview, skipped URLs and whether the run's charge limit was reached.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "pdfUrls": [
        "https://datasheets.raspberrypi.com/rpi5/raspberry-pi-5-mechanical-drawing.pdf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("madrasco/drawing-pdf-dimension-extractor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "pdfUrls": ["https://datasheets.raspberrypi.com/rpi5/raspberry-pi-5-mechanical-drawing.pdf"] }

# Run the Actor and wait for it to finish
run = client.actor("madrasco/drawing-pdf-dimension-extractor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "pdfUrls": [
    "https://datasheets.raspberrypi.com/rpi5/raspberry-pi-5-mechanical-drawing.pdf"
  ]
}' |
apify call madrasco/drawing-pdf-dimension-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,madrasco/drawing-pdf-dimension-extractor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/YVbcnV6dua3wpdNK5/builds/WkQgiu6IFkmiKUgDO/openapi.json
