# exportPdf method

Information noteSTABLE.   
  
This API is reliable and breaking changes are unlikely.

qlik.app.visualization.exportPdf(settings)

Exports a QVisualization instance to PDF.

## Version history

Version history

| Version state | Details |
| --- | --- |
| Introduced | Qlik Sense September 2018 |

## Parameters

### settings

Type: Object

PDF export settings.

Properties

settings object properties

| Name | Type | Description |
| --- | --- | --- |
| documentSize | String \| ObjectMetricSize | Page size of the output PDF. Can be an object with custom size in millimeters or a string with one of the following document formats:<br><br><ul> <li><span>a3</span> </li> <li><span>a4</span> </li> <li><span>a5</span> </li> <li><span>a6</span> </li> <li><span>a7</span> </li> </ul> |
| orientation | String | Ignored if documentSize is an object. Can be:<br><br><ul> <li><span>portrait</span> </li> <li><span>landscape</span> </li> </ul><br><br>Default is landscape. |
| aspectRatio | Number | Specifies the aspect ratio. Can be:<br><br><ul> <li><span>0</span>: as specified in <span>objectSize</span></li> <li><span>2</span>: fit to page</li> </ul><br><br>Default is JPG. |
| objectSize | ObjectPixelSize | Exported object height and width in pixels. Required when aspectRatio: 0. |

## Returns

A promise of a link to the exported file.

## Example 1: specifies a string for the document size

```
var settings = { documentSize: 'a4', aspectRatio: 2, orientation: "landscape" }

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d', config);
app.visualization.get('xGhjKl').then(function(vis){
  vis.exportPdf(settings).then(function (result) {
    console.log('PDF download link: ', result);
  });
});
```

## Example 2: specifies a custom setting for the document size

```
var settings = { documentSize: {height: 200, width: 200}, aspectRatio: 2, orientation: "landscape" }
```