# Generate Multi-Page PDF for Printing

{% hint style="info" %}
This feature is available from the [**Suite**](https://www.abyssale.com/pricing) plan.
{% endhint %}

### Asynchronous Asset Generation Endpoint

`POST /async/banner-builder/{design_id}/generate`

### Generation Characteristics

* Supported Design Type: **Print multi page**
* Response: **Asynchronous**
* Enables batch generation of multiple assets
* Retrieval methods:
  * Webhooks
  * Polling

### Output File Types

Supported formats:

* Multi page printable PDF

### Additional information

#### Retrieval Mechanism

* Initial request returns a `generation_request_id`
* You can track generation status and retrieve results using:
  * [Webhook notifications](/rest-api/generation/asynchronous-generation.md#webhook-configuration)
  * [Periodic API polling](/rest-api/generation/asynchronous-generation.md#polling-configuration)

#### Key feature

* Supports bulk asset creation
* Allows handling of complex or time-consuming generation tasks
* Provides flexibility in result retrieval

#### Output customisation

In addition to the supported image properties, a `print` property can be set to customise the output PDF. Here is the available option:

#### Display crop marks

* Default:  the value you have in the builder
* Boolean

#### Color profile

| uuid                                 | description                          |
| ------------------------------------ | ------------------------------------ |
| be2ab219-8fe4-4d85-91ba-65bdc9ddaf01 | CMYK - ISO Coated v2 (ECI)           |
| 03738f37-5b6f-4be9-9100-706b1711f9dd | CMYK - ISO Coated v2 (ECI) 300%      |
| e0c86a8a-050c-41f1-885a-0f74b9baac50 | CMYK - ISO Uncoated                  |
| 0e0355e6-2931-4c83-92f2-64db9f5ddffc | CMYK - US Web Coated (SWOP 2006 5v2) |
| db3c123e-1127-11ef-b77e-f93002785645 | RGB - No color profile included      |
| fac91df8-1155-11ef-b77e-f93002785645 | CMYK - ISO Newspaper26 v4            |

Configuration Example:

```json
"print": {
 "display_crop_marks": true,
 "color_profile": "e0c86a8a-050c-41f1-885a-0f74b9baac50"
}
```

### Multi page print design

<figure><img src="/files/HtZK4Gc6bnzbwkhCdd1G" alt=""><figcaption></figcaption></figure>

### Sample request

Do not forget to replace `{YOUR-API-KEY}` and `{design_id}`

{% tabs %}
{% tab title="cURL" %}

```
curl -X POST -H "x-api-key:{YOUR-API-KEY}" -H "Content-Type: application/json"  \
-d '{
  "pages": {
    "page_1": {
      "root": {
        "background_color": "cmyka(0,0,0,0,100)"
      },
      "tb-image_0": {
        "image_url": "https://mycompany.com/image.jpeg"
      },
      "tb-text_0": {
        "payload": "Lorem Ipsum"
      }
    },
    "page_2": {
      "root": {
        "background_color": "cmyka(0,0,0,0,100)"
      },
      "tb-image_0": {
        "image_url": "https://mycompany.com/image.jpeg"
      },
      "tb-text_0": {
        "payload": "Lorem Ipsum"
      },
      "tb-text_1": {
        "payload": "Lorem Ipsum"
      }
    }
}' \
https://api.abyssale.com/async/banner-builder/{design_id}/generate
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
const axios = require('axios');

const payload = {
  "pages": {
    "page_1": {
      "root": {
        "background_color": "cmyka(0,0,0,0,100)"
      },
      "tb-image_0": {
        "image_url": "https://mycompany.com/image.jpeg"
      },
      "tb-text_0": {
        "payload": "Lorem Ipsum"
      }
    },
    "page_2": {
      "root": {
        "background_color": "cmyka(0,0,0,0,100)"
      },
      "tb-image_0": {
        "image_url": "https://mycompany.com/image.jpeg"
      },
      "tb-text_0": {
        "payload": "Lorem Ipsum"
      },
      "tb-text_1": {
        "payload": "Lorem Ipsum"
      }
    }
}

axios.post("https://api.abyssale.com/async/banner-builder/{design_id}/generate", payload, {
    headers: {"x-api-key": "{YOUR-API-KEY}", "Content-Type": "application/json", "timeout": 30000}
  }).then(response => {
    console.log(response.data)
})
```

{% endtab %}

{% tab title="Python" %}

```python
import json
import requests

image_generation_payload = {
  "pages": {
    "page_1": {
      "root": {
        "background_color": "cmyka(0,0,0,0,100)"
      },
      "tb-image_0": {
        "image_url": "https://mycompany.com/image.jpeg"
      },
      "tb-text_0": {
        "payload": "Lorem Ipsum"
      }
    },
    "page_2": {
      "root": {
        "background_color": "cmyka(0,0,0,0,100)"
      },
      "tb-image_0": {
        "image_url": "https://mycompany.com/image.jpeg"
      },
      "tb-text_0": {
        "payload": "Lorem Ipsum"
      },
      "tb-text_1": {
        "payload": "Lorem Ipsum"
      }
    }
}

r = requests.post("https://api.abyssale.com/async/banner-builder/{design_id}/generate",
  headers={"x-api-key": "YOUR-API-KEY", "Content-Type": "application/json"},
  data=json.dumps(image_generation_payload),
  timeout=30
)
r.json()
```

{% endtab %}
{% endtabs %}

### Sample response

```json
{"generation_request_id": "166e1852-dc97-43e3-a5f2-142076452c74"}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.abyssale.com/rest-api/generation/asynchronous-generation/generate-multi-page-pdf-for-printing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
