# Krakt Plotz (`kurtholes/krakt-plotz`) Actor

Batch-convert DWG files to PDF and DXF. Paste URLs or upload files, get print-ready PDFs and clean DXFs back. Open-source LibreDWG engine, no AutoCAD, about $0.01 per file.

- **URL**: https://apify.com/kurtholes/krakt-plotz.md
- **Developed by:** [Kurt Holes](https://apify.com/kurtholes) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 file converteds

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

## Krakt Plotz: DWG to PDF & DXF, in bulk, for a cent a file

Got a folder of DWGs and no AutoCAD seat? Drop in the links, hit Start, grab your PDFs and DXFs. **About $0.01 per file.**

- **Batch it**: 1 file or 1,000. Paste URLs, upload a file, or point at key-value store records.
- **PDF, DXF or both**: print-ready PDFs (A4 to A0, Letter, Tabloid, ARCH-D or fit-to-drawing) plus a DXF any CAD tool opens.
- **R13 to 2018+**: AutoCAD R13, R14, 2000, 2004, 2007, 2010, 2013 and 2018+ files.
- **No AutoCAD, no ODA**: runs on open-source [LibreDWG](https://www.gnu.org/software/libredwg/) and [ezdxf](https://ezdxf.mozman.at/).
- **Honest output**: every file reports its DWG version, entity and layer counts, anything we skipped, and a clear error if it failed. You're only charged for files that convert.

### What gets drawn

Lines, polylines, arcs, circles, ellipses, text and layers render well. Hatches and blocks usually come through too. **Complex stuff may be skipped**: 3D solids, regions, tolerances, proxy/custom objects and some dimension styles. The `skippedEntityTypes` field tells you exactly what was left out. If the model space is empty, Plotz plots the first paper-space layout instead (viewport contents aren't drawn).

### Quick start

```json
{
  "dwgUrls": ["https://example.com/plans/ground-floor.dwg", "https://example.com/plans/roof.dwg"],
  "outputFormat": "both",
  "pageSize": "A3"
}
```

| Field | Default | What it does |
|---|---|---|
| `dwgUrls` | – | Direct links to .dwg files |
| `dwgUpload` | – | Upload one file straight from the Console |
| `kvStoreRecords` | – | `storeId/key` (or `key` for this run's store) |
| `outputFormat` | `both` | `pdf`, `dxf` or `both` |
| `pageSize` | `A3` | `fit`, `A4`–`A0`, `letter`, `tabloid`, `ARCH-D` |
| `orientation` | `auto` | `auto`, `landscape`, `portrait` |
| `keepColors` | `false` | Off = black-ink plot. On = CAD colors on white |
| `darkBackground` | `false` | CAD-screen look: black background, true colors |
| `maxFiles` / `maxFileSizeMb` | 100 / 50 | Safety caps |

### Output

One dataset row per DWG:

```json
{
  "source": "https://example.com/plans/ground-floor.dwg",
  "fileName": "ground-floor.dwg",
  "status": "converted",
  "dwgVersion": "R2018+",
  "pdfUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/001-ground-floor.pdf",
  "dxfUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/001-ground-floor.dxf",
  "entities": 896, "layers": 24,
  "skippedEntityTypes": [], "warnings": [], "error": null
}
```

The files themselves sit in the run's key-value store. Failed files get `status: "failed"` and an `error` message, and they're free.

### Pricing

**$0.01 per converted file** (event `file-converted`), whether you ask for PDF, DXF or both. Failed files cost nothing. A run with no files given converts one sample drawing for free (`demo: true`) so you can see the output. Set a max cost per run and Plotz stops cleanly when it's reached.

### Good to know

- Fidelity isn't AutoCAD's. For contract-grade plots, use the software that made the file.
- Fonts are swapped for open fonts (DejaVu/Liberation), so text spacing can shift a little.
- Not tested with password-protected or corrupt DWGs; those fail with an error.
- The DXF comes straight out of LibreDWG's `dwg2dxf`, and the PDF is a vector plot of model space.
- Not affiliated with Autodesk. DWG is a trademark of Autodesk, Inc.

# Actor input Schema

## `dwgUrls` (type: `array`):

Direct links to .dwg files (public URLs, signed S3/GCS links, Dropbox ?dl=1 links...). One file per line.

## `dwgUpload` (type: `string`):

Drop a single .dwg here. It is stored in a key-value store and converted like any URL.

## `kvStoreRecords` (type: `array`):

Optional. DWGs already in an Apify key-value store, as 'storeId/key' (or just 'key' for this run's default store).

## `outputFormat` (type: `string`):

What to produce for each DWG.

## `pageSize` (type: `string`):

Paper size for PDFs. 'Fit' sizes the page to the drawing.

## `orientation` (type: `string`):

Auto picks landscape or portrait from the drawing's shape.

## `keepColors` (type: `boolean`):

Off = crisp black-ink plot (best for printing). On = keep CAD colors on white paper (white lines become black).

## `darkBackground` (type: `boolean`):

Render like the CAD screen: black background, true colors. Off = white paper, print-ready.

## `maxFiles` (type: `integer`):

Safety cap per run. Each converted file is billed once.

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

Bigger downloads are skipped.

## Actor input object example

```json
{
  "dwgUrls": [
    "https://raw.githubusercontent.com/LibreDWG/libredwg/master/test/test-data/example_2018.dwg"
  ],
  "outputFormat": "both",
  "pageSize": "A3",
  "orientation": "auto",
  "keepColors": false,
  "darkBackground": false,
  "maxFiles": 100,
  "maxFileSizeMb": 50
}
```

# Actor output Schema

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

No description

## `store` (type: `string`):

No description

# 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 = {
    "dwgUrls": [
        "https://raw.githubusercontent.com/LibreDWG/libredwg/master/test/test-data/example_2018.dwg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kurtholes/krakt-plotz").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 = { "dwgUrls": ["https://raw.githubusercontent.com/LibreDWG/libredwg/master/test/test-data/example_2018.dwg"] }

# Run the Actor and wait for it to finish
run = client.actor("kurtholes/krakt-plotz").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 '{
  "dwgUrls": [
    "https://raw.githubusercontent.com/LibreDWG/libredwg/master/test/test-data/example_2018.dwg"
  ]
}' |
apify call kurtholes/krakt-plotz --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kurtholes/krakt-plotz"
        }
    }
}
```

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/keZgUga1ISZe6P8LT/builds/pX7F0MUE2xYyvgPGn/openapi.json
