exportPdf method
Information noteSTABLE.
This API is reliable and breaking changes are unlikely.
This API is reliable and breaking changes are unlikely.
qlik.app.visualization.exportPdf(settings)
Exports a QVisualization instance to PDF.
Version history
Version state | Details |
---|---|
Introduced | Qlik Sense September 2018 |
Parameters
settings
Type: Object
PDF export settings.
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:
|
orientation | String |
Ignored if documentSize is an object. Can be:
Default is landscape. |
aspectRatio | Number |
Specifies the aspect ratio. Can be:
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" }