# Convert HTML invoices to PDF in batch

**Use case:** 

Renders a batch of HTML documents, such as invoices or reports, into PDF files without needing a web page URL. Each document becomes one named PDF in the key-value store, with a direct download link in the dataset. Good for generating documents from templates.

## Input

```json
{
  "urls": [
    "https://example.com",
    "https://apify.com"
  ],
  "htmlName": "html",
  "htmlPages": [
    {
      "name": "invoice-001",
      "html": "<html><body><h1>Invoice #001</h1><p>Total: $120</p></body></html>"
    },
    {
      "name": "invoice-002",
      "html": "<html><body><h1>Invoice #002</h1><p>Total: $80</p></body></html>"
    }
  ],
  "formats": [
    "pdf"
  ],
  "fullPage": true,
  "jpegQuality": 80,
  "maxPageHeight": 20000,
  "viewportWidth": 1280,
  "viewportHeight": 800,
  "deviceScaleFactor": 1,
  "device": "desktop",
  "colorScheme": "light",
  "waitUntil": "load",
  "delayMs": 1000,
  "scrollToBottom": true,
  "hideCookieBanners": true,
  "hideSelectors": [],
  "pdfFormat": "A4",
  "pdfLandscape": false,
  "pdfPrintBackground": true,
  "pdfUseScreenMedia": false,
  "pdfSinglePage": false,
  "pdfMargin": "0",
  "captureErrorPages": false,
  "navigationTimeoutSecs": 60,
  "maxRetries": 2,
  "maxConcurrency": 2,
  "onlyNew": false,
  "extractText": false
}
```

## Output

```json
{
  "status": {
    "label": "Status",
    "format": "string"
  },
  "url": {
    "label": "URL",
    "format": "string"
  },
  "name": {
    "label": "Name",
    "format": "string"
  },
  "format": {
    "label": "Format",
    "format": "string"
  },
  "fileUrl": {
    "label": "File",
    "format": "string"
  },
  "pageTitle": {
    "label": "Page title",
    "format": "string"
  },
  "httpStatus": {
    "label": "HTTP",
    "format": "integer"
  },
  "fileSizeBytes": {
    "label": "Size (bytes)",
    "format": "integer"
  },
  "capturedAt": {
    "label": "Captured at",
    "format": "string"
  },
  "errorMessage": {
    "label": "Error message",
    "format": "string"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Website Screenshot API: Full Page PNG, JPEG & PDF Actor is ready to run with the inputs already set for "Convert HTML invoices to PDF in batch". [Sign up or log in](https://console.apify.com/create-task-from-example/yA4wrP4l3eTUvqF66) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Convert HTML invoices to PDF in batch" task

The Website Screenshot API: Full Page PNG, JPEG & PDF Actor will start running based on the input automatically. You can also change all the input fields, like URLs, name for the raw html file, and more, to match your specific use case.

### 3. Receive the "Convert HTML invoices to PDF in batch" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as status, URL, name, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Convert HTML invoices to PDF in batch" task via API](https://apify.com/actose/website-screenshot-pdf.md).

## About this Actor

This example demonstrates how to use [Website Screenshot API: Full Page PNG, JPEG & PDF](https://apify.com/actose/website-screenshot-pdf.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/actose/website-screenshot-pdf.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/actose/website-screenshot-pdf.md

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`).
