# Cost Sheet Generator (`moving_beacon-owner1/my-actor-75`) Actor

Cloud-native version of the Art Pro Sublimation desktop cost sheet tool. Provide image URLs, set your rate, and get back a branded Excel invoice — ready to download and print on A4.

- **URL**: https://apify.com/moving\_beacon-owner1/my-actor-75.md
- **Developed by:** [Jamshaid Arif](https://apify.com/moving_beacon-owner1) (community)
- **Categories:** Automation, Developer tools, Integrations
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## 🖨️ — Cost Sheet Generator 

Cloud-native version of the **Art Pro Sublimation** desktop cost sheet tool. Provide image URLs, set your rate, and get back a **branded Excel invoice** — ready to download and print on A4.

---

### How It Works

1. You provide a list of **image URLs** (print-ready files)
2. The actor **downloads each image**, reads its pixel dimensions and DPI
3. It **parses the filename** to extract quantity and description
4. It **calculates area (sqft) and cost** at your specified rate
5. It **generates a branded .xlsx invoice** with the full Art Pro layout
6. The Excel file is stored in the **Key-Value Store** with a **direct download URL**

---

### Filename Convention

Images should follow this naming pattern for automatic parsing:

````

{number}{separator}{quantity}{description}.ext

````

| Example Filename | File ## | Qty | Description |
|---|---|---|---|
| `1-2 Large Banner.jpg` | 1 | 2 | Large Banner |
| `2-1_SmallPoster.png` | 2 | 1 | SmallPoster |
| `3-5 Flex Board.tif` | 3 | 5 | Flex Board |
| `logo.jpg` | 0 | 1 | logo *(fallback)* |

---

### Input Example

```json
{
    "images": [
        { "url": "https://example.com/1-2_LargeBanner.jpg" },
        { "url": "https://example.com/2-1_SmallPoster.png", "filename": "2-1 Small Poster.png" },
        { "url": "https://example.com/3-5_FlexBoard.tif" }
    ],
    "rate": 35,
    "invoiceNo": "INV-0042",
    "customerName": "Ali Traders",
    "folderName": "March Batch",
    "designer": "Usman",
    "comments": "Urgent delivery",
    "printType": "CHINA/NORMAL/FLU",
    "logoUrl": "https://example.com/logo.jpeg",
    "outputFilename": "cost_sheet.xlsx"
}
````

***

### Output

#### 1. Excel Cost Sheet (.xlsx)

Stored in the **Key-Value Store**. The **direct download URL** is included in both the actor logs and the dataset output, e.g.:

```
https://api.apify.com/v2/key-value-stores/{id}/records/cost_sheet.xlsx
```

The Excel file features:

- Yellow / Blue / Orange branded accent stripes
- Black header band with company name and contact
- Rate and QR area in the header
- Invoice metadata (number, customer, designer, comments)
- 10-column data table (S No, QTY, Description, W×L, T/F, Price, Amount)
- Alternating row shading
- Auto multi-sheet (new sheet every 35 items, continuous numbering)
- Grand totals in PKR
- Fit-to-page A4 print layout

#### 2. Structured JSON Summary

Pushed to the **Dataset** output:

- `download_url` — direct link to the Excel file
- `total_sqft`, `total_cost_pkr` — grand totals
- `line_items[]` — per-image breakdown (dimensions, DPI, cost)
- `skipped[]` — any images that failed with error details

***

### Configuration

| Parameter | Type | Default | Description |
|---|---|---|---|
| `images` | array | *(required)* | Image objects with `url` and optional `filename` |
| `rate` | integer | `35` | PKR per square foot |
| `lengthOverride` | integer | `0` | Force width in inches (0 = auto from DPI) |
| `invoiceNo` | string | `""` | Invoice reference number |
| `customerName` | string | `""` | Customer name on the invoice |
| `folderName` | string | `""` | Order / folder label |
| `designer` | string | `""` | Designer name |
| `comments` | string | `""` | Comments line |
| `printType` | string | `CHINA/NORMAL/FLU` | Print type label |
| `logoUrl` | string | `""` | URL to a logo image for the header |
| `outputFilename` | string | `cost_sheet.xlsx` | Output filename |

***

### License

ISC

# Actor input Schema

## `images` (type: `array`):

List of print-ready images. Each item needs a 'url' and an optional 'filename'. If filename is omitted, it is derived from the URL. Use the naming convention: {number}{separator}{quantity}{description}.ext (e.g., '1-2 Banner Design.jpg' means file #1, print 2 copies, description 'Banner Design').

## `rate` (type: `integer`):

Price per square foot in PKR.

## `lengthOverride` (type: `integer`):

Force a specific width in inches instead of reading from image DPI. Leave 0 to auto-detect.

## `invoiceNo` (type: `string`):

Invoice reference number.

## `customerName` (type: `string`):

Name of the customer.

## `folderName` (type: `string`):

Order or folder label shown on the invoice.

## `designer` (type: `string`):

Designer name.

## `comments` (type: `string`):

Any comments to print on the invoice.

## `printType` (type: `string`):

Type of print job.

## `logoUrl` (type: `string`):

URL to a logo image (JPEG/PNG) to embed in the invoice header. Leave empty for no logo.

## `outputFilename` (type: `string`):

Name for the generated Excel file.

## Actor input object example

```json
{
  "images": [
    {
      "url": "https://example.com/1-2_LargeBanner.jpg"
    },
    {
      "url": "https://example.com/2-1_SmallPoster.png",
      "filename": "2-1 Small Poster.png"
    }
  ],
  "rate": 35,
  "lengthOverride": 0,
  "invoiceNo": "",
  "customerName": "",
  "folderName": "",
  "designer": "",
  "comments": "",
  "printType": "CHINA/NORMAL/FLU",
  "logoUrl": "",
  "outputFilename": "cost_sheet.xlsx"
}
```

# Actor output Schema

## `results` (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 = {
    "images": [
        {
            "url": "https://example.com/1-2_LargeBanner.jpg"
        },
        {
            "url": "https://example.com/2-1_SmallPoster.png",
            "filename": "2-1 Small Poster.png"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("moving_beacon-owner1/my-actor-75").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 = { "images": [
        { "url": "https://example.com/1-2_LargeBanner.jpg" },
        {
            "url": "https://example.com/2-1_SmallPoster.png",
            "filename": "2-1 Small Poster.png",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("moving_beacon-owner1/my-actor-75").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "images": [
    {
      "url": "https://example.com/1-2_LargeBanner.jpg"
    },
    {
      "url": "https://example.com/2-1_SmallPoster.png",
      "filename": "2-1 Small Poster.png"
    }
  ]
}' |
apify call moving_beacon-owner1/my-actor-75 --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=moving_beacon-owner1/my-actor-75",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Cost Sheet Generator",
        "description": "Cloud-native version of the Art Pro Sublimation desktop cost sheet tool. Provide image URLs, set your rate, and get back a branded Excel invoice — ready to download and print on A4.",
        "version": "0.0",
        "x-build-id": "X5oU2Ux37HDszLqVs"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/moving_beacon-owner1~my-actor-75/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-moving_beacon-owner1-my-actor-75",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/moving_beacon-owner1~my-actor-75/runs": {
            "post": {
                "operationId": "runs-sync-moving_beacon-owner1-my-actor-75",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/moving_beacon-owner1~my-actor-75/run-sync": {
            "post": {
                "operationId": "run-sync-moving_beacon-owner1-my-actor-75",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "images",
                    "rate"
                ],
                "properties": {
                    "images": {
                        "title": "Images",
                        "type": "array",
                        "description": "List of print-ready images. Each item needs a 'url' and an optional 'filename'. If filename is omitted, it is derived from the URL. Use the naming convention: {number}{separator}{quantity}{description}.ext (e.g., '1-2 Banner Design.jpg' means file #1, print 2 copies, description 'Banner Design').",
                        "items": {
                            "type": "object",
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "Image URL",
                                    "description": "Direct URL to the image file"
                                },
                                "filename": {
                                    "type": "string",
                                    "title": "Filename Override",
                                    "description": "Override filename (must follow naming convention for auto-parsing)"
                                }
                            },
                            "required": [
                                "url"
                            ]
                        }
                    },
                    "rate": {
                        "title": "Rate (PKR per sqft)",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Price per square foot in PKR.",
                        "default": 35
                    },
                    "lengthOverride": {
                        "title": "Width Override (inches)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Force a specific width in inches instead of reading from image DPI. Leave 0 to auto-detect.",
                        "default": 0
                    },
                    "invoiceNo": {
                        "title": "Invoice Number",
                        "type": "string",
                        "description": "Invoice reference number.",
                        "default": ""
                    },
                    "customerName": {
                        "title": "Customer Name",
                        "type": "string",
                        "description": "Name of the customer.",
                        "default": ""
                    },
                    "folderName": {
                        "title": "Folder / Order Name",
                        "type": "string",
                        "description": "Order or folder label shown on the invoice.",
                        "default": ""
                    },
                    "designer": {
                        "title": "Designer",
                        "type": "string",
                        "description": "Designer name.",
                        "default": ""
                    },
                    "comments": {
                        "title": "Comments",
                        "type": "string",
                        "description": "Any comments to print on the invoice.",
                        "default": ""
                    },
                    "printType": {
                        "title": "Print Type",
                        "type": "string",
                        "description": "Type of print job.",
                        "default": "CHINA/NORMAL/FLU"
                    },
                    "logoUrl": {
                        "title": "Logo Image URL",
                        "type": "string",
                        "description": "URL to a logo image (JPEG/PNG) to embed in the invoice header. Leave empty for no logo.",
                        "default": ""
                    },
                    "outputFilename": {
                        "title": "Output Filename",
                        "type": "string",
                        "description": "Name for the generated Excel file.",
                        "default": "cost_sheet.xlsx"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
