Scaling the Drawings

The Drawing library enables you to export a PDF document that is bigger or smaller than its original elements.

The scaling feature is convenient when you generate a multi-page PDF output by using the automatic page-breaking feature. Because the original dimensions usually look too big in PDF, you can specify a suitable scale factor to get a better output for print. To scale the content when you export files to PDF, use the scale option from the Drawing library. While the scale setting affects the content, the output paper size and page margins remain the same. However, scaling affects the position of the headers and footers of page templates.

For more information on how to scale the content with the PDF Export component, refer to its documentation.

The following example demonstrates how to set a scale factor of 0.8 and keep an A4 page size and a two-centimeter page margin.

import { drawDOM, exportPDF, DrawOptions, Group } from '@progress/kendo-drawing';
import { saveAs } from '@progress/kendo-file-saver';

export function exportElement(element, options) {
    drawDOM(element, options).then((group) => {
        return exportPDF(group);
    }).then((dataUri) => {
        saveAs(dataUri, 'export.pdf');
    });
}
In this article
 /