Skip to main content Skip to complementary content

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:

  • a3
  • a4
  • a5
  • a6
  • a7
orientation String

Ignored if documentSize is an object. Can be:

  • portrait
  • landscape

Default is landscape.

aspectRatio Number

Specifies the aspect ratio. Can be:

  • 0: as specified in objectSize
  • 2: fit to page

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" }

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!