# PDF Transformation

The following API services are now available for PDF transformation.

* [Convert PDF to PNG image](#transform-pdf-to-png-image)
* [Convert PDF to Postscript ](#transform-pdf-to-postscript)

{% hint style="info" %}
PDF transformation APIs are available in EU region only. Please make sure you are subscribed to a specific region before making API calls.
{% endhint %}

## Transform PDF to PNG image

Convert single and multi page PDF documents into static PNGs.

## Generate PNG Image

<mark style="color:green;">`POST`</mark> `https://api-eu.renda.io/converter/generateImage`

This API enables conversion of PDF document into PNG Image.&#x20;

A single page PDF will return PNG payload as a response.&#x20;

A multi-page PDF will be transformed into multiple PNGs based on the number of pages in the PDF document. A zip archived payload of the PNGs will be returned as a API response.\
\
Region specific URLs:\
\
Ireland(Europe): `https://api-eu.renda.io/converter/generateImage`<br>

#### Headers

| Name                                           | Type   | Description         |
| ---------------------------------------------- | ------ | ------------------- |
| x-api-key<mark style="color:red;">\*</mark>    | String | Renda API Key       |
| Content-type<mark style="color:red;">\*</mark> | String | multipart/form-data |

#### Request Body

| Name                                          | Type | Description  |
| --------------------------------------------- | ---- | ------------ |
| pdfDocument<mark style="color:red;">\*</mark> | File | PDF Document |

{% tabs %}
{% tab title="200: OK PNG image will be returned for a single page PDF. A zip archive will be returned for multi page PDF" %}

```javascript
{
    //Single page PDF will return application/png as API response
    //Multi page PDF will return application/zip as API response containing one PNG for each page
}
```

{% endtab %}

{% tab title="400: Bad Request Processing error" %}

```javascript
{
    // Response from server
}
```

{% endtab %}

{% tab title="403: Forbidden Invalid API Key" %}

```json
{
"message":"We are unable to service your request. Things to verify: 
1) A valid API Key should be passed in ‘x-api-key’ request header parameter.
 2) An active Renda.io subscription 3) API being invoked must be Subscribed 
 using the Subscribe button in Renda developer portal. Please refer to Renda 
 documentation for more details - https://documentation.renda.io"
}
```

{% endtab %}
{% endtabs %}

## Transform PDF to Postscript

Convert single and multi page PDF documents into printer friendly postscript document.

## Generate Postscript document

<mark style="color:green;">`POST`</mark> `https://api-eu.renda.io/converter/generatePostscript`

This API enables conversion of PDF document into postscript document.&#x20;

#### Headers

| Name                                           | Type   | Description         |
| ---------------------------------------------- | ------ | ------------------- |
| x-api-key<mark style="color:red;">\*</mark>    | String | Renda API Key       |
| Content-Type<mark style="color:red;">\*</mark> | String | multipart/form-data |

#### Request Body

| Name                                          | Type | Description  |
| --------------------------------------------- | ---- | ------------ |
| pdfDocument<mark style="color:red;">\*</mark> | File | PDF Document |

{% tabs %}
{% tab title="200: OK Postscript document will be returned" %}

```javascript
{
    // Payload with application/postscript will be returned
}
```

{% endtab %}

{% tab title="400: Bad Request Processing error" %}

```javascript
{
    // Error Response from server
}
```

{% endtab %}

{% tab title="403: Forbidden Invalid API Key" %}

```json
{
"message":"We are unable to service your request. Things to verify: 
1) A valid API Key should be passed in ‘x-api-key’ request header parameter.
 2) An active Renda.io subscription 3) API being invoked must be Subscribed 
 using the Subscribe button in Renda developer portal. Please refer to Renda 
 documentation for more details - https://documentation.renda.io"
}
```

{% endtab %}
{% endtabs %}
